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

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

Issue 2207183002: [wasm] Require global names to be validate UTF-8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 ad2124ed98a776beb53395ca8c71601c1e57bb10..846da49bdb822a66eff15c9322b8226135e41a2b 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -461,8 +461,10 @@ class ModuleDecoder : public Decoder {
// Decodes a single global entry inside a module starting at {pc_}.
void DecodeGlobalInModule(WasmGlobal* global) {
global->name_offset = consume_string(&global->name_length, false);
- DCHECK(unibrow::Utf8::Validate(start_ + global->name_offset,
- global->name_length));
+ if (!unibrow::Utf8::Validate(start_ + global->name_offset,
+ global->name_length)) {
+ error("global name is not valid utf8");
+ }
global->type = consume_local_type();
global->offset = 0;
global->exported = consume_u8("exported") != 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698