summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-04-29 16:55:46 +0200
committerDamjan Marion <dmarion@me.com>2019-05-01 18:11:10 +0000
commiteecdf93aeaf59e65dfeb57cdeae75ff9675d9c0f (patch)
tree611565ae94b9c03651b000bd160e1092677b8853
parentef1ae3ad01ab2a02c085dbbe5473d8109f5f1aea (diff)
svm: remove dead code triggering overflow
split_point is incremented twice per iteration whereas we only check for *split_point != '\0' at the beginning of the iteration. This code seems dead so remove it altogether. Change-Id: Iabaf26cd5c0c8f747e267bcff044540a2376d3f6 Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rw-r--r--src/svm/svm.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/svm/svm.c b/src/svm/svm.c
index 4aefd20da86..421121957f0 100644
--- a/src/svm/svm.c
+++ b/src/svm/svm.c
@@ -436,10 +436,7 @@ svm_data_region_map (svm_map_region_args_t * a, svm_region_t * rp)
u8 *
shm_name_from_svm_map_region_args (svm_map_region_args_t * a)
{
- u8 *path;
u8 *shm_name;
- u8 *split_point;
- u8 *mkdir_arg = 0;
int root_path_offset = 0;
int name_offset = 0;
@@ -449,29 +446,6 @@ shm_name_from_svm_map_region_args (svm_map_region_args_t * a)
if (a->root_path[0] == '/')
root_path_offset++;
- /* create the root_path under /dev/shm
- iterate through path creating directories */
-
- path = format (0, "/dev/shm/%s%c", &a->root_path[root_path_offset], 0);
- split_point = path + 1;
- vec_add1 (mkdir_arg, '-');
-
- while (*split_point)
- {
- while (*split_point && *split_point != '/')
- {
- vec_add1 (mkdir_arg, *split_point);
- split_point++;
- }
- vec_add1 (mkdir_arg, 0);
-
- /* ready to descend another level */
- mkdir_arg[vec_len (mkdir_arg) - 1] = '-';
- split_point++;
- }
- vec_free (mkdir_arg);
- vec_free (path);
-
if (a->name[0] == '/')
name_offset = 1;