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

Unified Diff: test/unittests/wasm/module-decoder-unittest.cc

Issue 2301873002: [wasm] Read global names only if their name length is valid. (Closed)
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 | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/module-decoder-unittest.cc
diff --git a/test/unittests/wasm/module-decoder-unittest.cc b/test/unittests/wasm/module-decoder-unittest.cc
index 5c9c47ba00e075c8533cd12b3dd47d8b1f043247..03aa57c71ef368e7eda8f3fa71d01042c2f5536e 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -279,6 +279,18 @@ TEST_F(WasmModuleVerifyTest, GlobalWithInvalidNameOffset) {
EXPECT_FAILURE(data);
}
+TEST_F(WasmModuleVerifyTest, GlobalWithInvalidNameLength) {
+ static const byte data[] = {
+ SECTION(GLOBALS, 5), // --
+ 1,
+ NAME_LENGTH(56), // invalid length
+ 'g', // name
+ kLocalI32, // memory type
+ 0, // exported
+ };
+ EXPECT_FAILURE(data);
+}
+
TEST_F(WasmModuleVerifyTest, GlobalWithInvalidMemoryType) {
static const byte data[] = {
SECTION(GLOBALS, 7),
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698