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

Unified Diff: src/wasm/wasm-function-name-table.cc

Issue 2199333002: Fix an OOB read through CallSite.GetFunctionName (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/wasm-function-name-table.cc
diff --git a/src/wasm/wasm-function-name-table.cc b/src/wasm/wasm-function-name-table.cc
index cc52125500b9ed2b04e54249afd9546e6fd623f6..32c302d3c7b8fb359bc933fd389be2488c00609c 100644
--- a/src/wasm/wasm-function-name-table.cc
+++ b/src/wasm/wasm-function-name-table.cc
@@ -54,7 +54,7 @@ MaybeHandle<String> GetWasmFunctionNameFromTable(
uint32_t num_funcs = static_cast<uint32_t>(func_names_array->get_int(0));
DCHECK(static_cast<int>(num_funcs) >= 0);
Factory* factory = func_names_array->GetIsolate()->factory();
- DCHECK(func_index < num_funcs);
+ if (func_index >= num_funcs) return {};
int offset = func_names_array->get_int(func_index + 1);
if (offset < 0) return {};
int next_offset = func_index == num_funcs - 1
« 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