Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index 401fb1823973049a9f616662a79b9699e91c8530..f81b8f440b410219a523c64ee2245d5cac7bb8e3 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -251,7 +251,11 @@ class ModuleDecoder : public Decoder { |
} else { |
import->sig = module->signatures[import->sig_index]; |
} |
+ const byte* pos = pc_; |
import->module_name_offset = consume_string("import module name"); |
+ if (import->module_name_offset == 0) { |
+ error(pos, "import module name cannot be NULL"); |
+ } |
import->function_name_offset = |
consume_string("import function name"); |
} |