Skip to content

Fix collator_rulebased_fuzzer: stop masking errors by resetting UErrorCode#3920

Open
OwenSanzas wants to merge 1 commit intounicode-org:mainfrom
OwenSanzas:fix-collator-rulebased-fuzzer
Open

Fix collator_rulebased_fuzzer: stop masking errors by resetting UErrorCode#3920
OwenSanzas wants to merge 1 commit intounicode-org:mainfrom
OwenSanzas:fix-collator-rulebased-fuzzer

Conversation

@OwenSanzas
Copy link
Copy Markdown

Summary

After each ICU API call, the fuzzer resets status = U_ZERO_ERROR and continues execution regardless of whether the previous call failed. This masks errors and allows the fuzzer to call subsequent APIs on objects in an error state.

For example, if getVariableTop(status) fails, the fuzzer resets status and proceeds to call getCollationKey(), getRules(), etc. on a potentially invalid collator state.

Fix: Check U_FAILURE(status) after each API call and return early on error, instead of blindly resetting the error code.

Coverage comparison (60 seconds, empty seed corpus, ASan, libFuzzer)

Metric Original Fixed Change
Edge coverage 3509 3703 +5.53% (+194 edges)
Feature coverage 10231 11487 +12.28% (+1256 features)

Note: The edge coverage improvement may partially be due to fuzzer randomness, but confirms the fix does not regress coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant