Browse Source

[LibOS] Fix uninitialized value new_shargs.first

new_shargs used without initialization, could cause undefined behaviors as its contents are passed to other variables

Signed-off-by: Gary <gang1.wang@intel.com>
Gary 6 years ago
parent
commit
115edbf2fa
1 changed files with 1 additions and 1 deletions
  1. 1 1
      LibOS/shim/src/sys/shim_exec.c

+ 1 - 1
LibOS/shim/src/sys/shim_exec.c

@@ -330,7 +330,7 @@ err:
     }
 
     if (ret == -EINVAL) { /* it's a shebang */
-        LISTP_TYPE(sharg) new_shargs;
+        LISTP_TYPE(sharg) new_shargs = LISTP_INIT;
         struct sharg * next = NULL;
         bool ended = false, started = false;
         char buf[80];