svm: fix non-null-terminated string 18/28718/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 9 Sep 2020 08:00:34 +0000 (10:00 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Wed, 9 Sep 2020 14:49:59 +0000 (14:49 +0000)
Type: fix

Change-Id: Ia9cd71ce12584cd8ef90bfe357cf762dd7653f71
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/svm/svm.c

index 20f4b7a..fc91782 100644 (file)
@@ -330,7 +330,7 @@ svm_data_region_create (svm_map_region_args_t * a, svm_region_t * rp)
        }
       close (fd);
       CLIB_MEM_UNPOISON (rp->data_base, map_size);
-      rp->backing_file = (char *) format (0, "%s\0", a->backing_file);
+      rp->backing_file = (char *) format (0, "%s%c", a->backing_file, 0);
       rp->flags |= SVM_FLAGS_FILE;
     }