Commit 2aa80d0d authored by Kenton Varda's avatar Kenton Varda
parent fc970e8c
...@@ -685,7 +685,8 @@ struct WireHelpers { ...@@ -685,7 +685,8 @@ struct WireHelpers {
return result; return result;
} }
KJ_REQUIRE(elementTag->structRef.wordSize() / ELEMENTS * count <= wordCount, KJ_REQUIRE(elementTag->structRef.wordSize() / ELEMENTS *
ElementCount64(count) <= wordCount,
"Struct list pointer's elements overran size.") { "Struct list pointer's elements overran size.") {
return result; return result;
} }
...@@ -1663,7 +1664,7 @@ struct WireHelpers { ...@@ -1663,7 +1664,7 @@ struct WireHelpers {
ElementCount elementCount = tag->inlineCompositeListElementCount(); ElementCount elementCount = tag->inlineCompositeListElementCount();
auto wordsPerElement = tag->structRef.wordSize() / ELEMENTS; auto wordsPerElement = tag->structRef.wordSize() / ELEMENTS;
KJ_REQUIRE(wordsPerElement * elementCount <= wordCount, KJ_REQUIRE(wordsPerElement * ElementCount64(elementCount) <= wordCount,
"INLINE_COMPOSITE list's elements overrun its word count.") { "INLINE_COMPOSITE list's elements overrun its word count.") {
goto useDefault; goto useDefault;
} }
...@@ -1919,7 +1920,7 @@ struct WireHelpers { ...@@ -1919,7 +1920,7 @@ struct WireHelpers {
size = tag->inlineCompositeListElementCount(); size = tag->inlineCompositeListElementCount();
wordsPerElement = tag->structRef.wordSize() / ELEMENTS; wordsPerElement = tag->structRef.wordSize() / ELEMENTS;
KJ_REQUIRE(size * wordsPerElement <= wordCount, KJ_REQUIRE(ElementCount64(size) * wordsPerElement <= wordCount,
"INLINE_COMPOSITE list's elements overrun its word count.") { "INLINE_COMPOSITE list's elements overrun its word count.") {
goto useDefault; goto useDefault;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment