Skip to content

Commit 93a8ee2

Browse files
blendinDawn LUCI CQ
authored andcommitted
[DawnLPM] Fail when reaching ObjectHandle limits
This fixes a bug in DawnLPM serialization that causes the fuzzer to continue serializing after creating an invalid ObjectHandle that fils immediately when deserializing. Change-Id: I5c44973bfcb1fa972bbf2120481106171951b6d1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152581 Commit-Queue: Brendon Tiszka <[email protected]> Kokoro: Kokoro <[email protected]> Reviewed-by: Corentin Wallez <[email protected]> Reviewed-by: Loko Kung <[email protected]>
1 parent 8bf090f commit 93a8ee2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

generator/templates/dawn/fuzzers/lpmfuzz/DawnLPMSerializer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ namespace dawn::wire {
9191
if (objectStores[ObjectType::{{ member.handle_type.name.CamelCase() }}].Size() < DawnLPMFuzzer::k{{ member.handle_type.name.CamelCase() }}Limit) {
9292
{{ out }} = objectStores[ObjectType::{{ member.handle_type.name.CamelCase() }}].ReserveHandle();
9393
} else {
94-
{{ out }} = {0, 0};
94+
// Return failure in this case to guide the fuzzer away from generating too many
95+
// objects of this type
96+
return WireResult::FatalError;
9597
}
9698
{%- endmacro %}
9799

0 commit comments

Comments
 (0)