Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merged: [wasm] Require global names to be validate UTF-8.
Browse files Browse the repository at this point in the history
Revision: 6cf621e

BUG=chromium:628542
LOG=N
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
R=hablich@chromium.org

Review-Url: https://codereview.chromium.org/2248213003
Cr-Commit-Position: refs/branch-heads/5.3@{#44}
Cr-Branched-From: 820a23a-refs/heads/5.3.332@{#2}
Cr-Branched-From: 37538cb-refs/heads/master@{#37308}
  • Loading branch information
titzer authored and Commit bot committed Aug 17, 2016
1 parent f0a0638 commit 7683623
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wasm/module-decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,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 = mem_type();
global->offset = 0;
global->exported = consume_u8("exported") != 0;
Expand Down

0 comments on commit 7683623

Please sign in to comment.