Skip to content

fix(fuzz): drop a statically dead null guard in the markdown oracle - #20

Merged
g-cqd merged 1 commit into
mainfrom
fix/fuzz-dead-null-check
Aug 5, 2026
Merged

fix(fuzz): drop a statically dead null guard in the markdown oracle#20
g-cqd merged 1 commit into
mainfrom
fix/fuzz-dead-null-check

Conversation

@g-cqd

@g-cqd g-cqd commented Aug 5, 2026

Copy link
Copy Markdown
Owner

CodeQL #128 (js/comparison-between-incompatible-types).

extractFrontmatter returns an object literal on every path, so result == null can never be true — the comparison is statically dead.

It also bought nothing: had it ever returned null, the property reads that follow throw a TypeError, which the fuzzer reports as a crash exactly the same way. The assertions carrying the actual contract are unchanged — body is a string, body is never longer than the input, and a declined parse leaves the body untouched.

Re-fuzzed after the edit: 610,641 executions, no crashes.

CodeQL #128 (js/comparison-between-incompatible-types): extractFrontmatter
returns an object literal on every path, so `result == null` can never be
true and the comparison is dead.

It also bought nothing. Had it ever returned null, the property reads that
follow would throw a TypeError, which the fuzzer reports as a crash exactly
the same way. The assertions that carry the contract — body is a string,
body is never longer than the input, a declined parse leaves the body
untouched — are unchanged.

Re-fuzzed after the edit: 610,641 executions, no crashes.
@g-cqd
g-cqd merged commit 95c7306 into main Aug 5, 2026
9 checks passed
@g-cqd
g-cqd deleted the fix/fuzz-dead-null-check branch August 5, 2026 21:25
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