Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Unified Diff: src/wasm/module-decoder.cc

Issue 2656713003: [wasm] Fix check failure on invalid name section (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regression-684858.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/module-decoder.cc
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc
index 2a4752e0f6f5771c32bdb798bed18af1bea4e04b..39ecc422a8f145e4e3c22c41d8bd93b9a6840355 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -620,7 +620,7 @@ class ModuleDecoder : public Decoder {
uint32_t name_offset =
consume_string(inner, &function_name_length, false);
uint32_t func_index = i;
- if (func_index < module->functions.size()) {
+ if (inner.ok() && func_index < module->functions.size()) {
bradn 2017/01/25 11:18:05 Ah I see. Kind of goofy how this section is speced
titzer 2017/01/25 11:53:29 I'm OK with "best effort" if we just leave the nam
Mircea Trofin 2017/01/25 15:58:51 We should take a stance though and propose a PR on
Mircea Trofin 2017/01/25 16:42:00 Followed up with this PR, please take a look (incl
module->functions[func_index].name_offset = name_offset;
module->functions[func_index].name_length = function_name_length;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regression-684858.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698