소스 검색

wasm_application.c: Avoid null pointer dereference (#3620)

HongxiaWangSSSS 1 년 전
부모
커밋
7affac0ed3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/iwasm/common/wasm_application.c

+ 1 - 1
core/iwasm/common/wasm_application.c

@@ -513,7 +513,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
                         bh_memcpy_s(&u.val, sizeof(double), &ud.d,
                                     sizeof(double));
                     }
-                    if (endptr[0] == ':') {
+                    if (endptr && endptr[0] == ':') {
                         uint64 sig;
                         union ieee754_double ud;
                         sig = strtoull(endptr + 1, &endptr, 0);