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

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

Issue 2310023002: [wasm] Validate the length of strings before validating the string. (Closed)
Patch Set: Use consume_bytes to validate string length. Created 4 years, 3 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 03aa57c71ef368e7eda8f3fa71d01042c2f5536e..6716ed766ab45222b8b5e083c9b070bee255e4e9 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -1023,6 +1023,20 @@ TEST_F(WasmModuleVerifyTest, ExportTableOne) {
if (result.val) delete result.val;
}
+TEST_F(WasmModuleVerifyTest, ExportNameWithInvalidStringLength) {
+ static const byte data[] = {// signatures
+ SIGNATURES_SECTION_VOID_VOID,
+ ONE_EMPTY_FUNCTION,
+ SECTION(EXPORT_TABLE, 12),
+ 1, // exports
+ FUNC_INDEX(0), // --
+ NAME_LENGTH(84), // invalid string length
+ 'e', // --
+ ONE_EMPTY_BODY};
+
+ EXPECT_FAILURE(data);
+}
+
TEST_F(WasmModuleVerifyTest, ExportTableTwo) {
static const byte data[] = {// signatures
SIGNATURES_SECTION_VOID_VOID,
« 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