소스 검색

[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 7 년 전
부모
커밋
115edbf2fa
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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];