瀏覽代碼

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);