From eecdf93aeaf59e65dfeb57cdeae75ff9675d9c0f Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 29 Apr 2019 16:55:46 +0200 Subject: svm: remove dead code triggering overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/svm/svm.c | 26 -------------------------- 1 file changed, 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; -- cgit 1.2.3-korg