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/wasm-function-name-table.cc

Issue 1967023004: [wasm] Add UTF-8 validation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase on parallel compilation Created 4 years, 7 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 | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-function-name-table.cc
diff --git a/src/wasm/wasm-function-name-table.cc b/src/wasm/wasm-function-name-table.cc
index 9abcd9b0917364101225ea04b8095fec4c6b8f28..f08270410da6c6b1fa1c2a71535c92529c9de9d2 100644
--- a/src/wasm/wasm-function-name-table.cc
+++ b/src/wasm/wasm-function-name-table.cc
@@ -60,6 +60,9 @@ Handle<Object> GetWasmFunctionNameFromTable(Handle<ByteArray> func_names_array,
: func_names_array->get_int(func_index + 2);
ScopedVector<byte> buffer(next_offset - offset);
func_names_array->copy_out(offset, buffer.start(), next_offset - offset);
+ if (!unibrow::Utf8::Validate(buffer.start(), buffer.length())) {
+ return undefined();
+ }
MaybeHandle<Object> maybe_name =
func_names_array->GetIsolate()->factory()->NewStringFromUtf8(
Vector<const char>::cast(buffer));
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698