Skip to content

luzer: support multiple corpus directories - #108

Merged
ligurio merged 2 commits into
masterfrom
ligurio/gh-xxxx-fix-oss-fuzz-coverage
Nov 4, 2026
Merged

ligurio merged 2 commits into
masterfrom
ligurio/gh-xxxx-fix-oss-fuzz-coverage

Conversation

@ligurio

@ligurio ligurio commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

@ligurio
ligurio requested a review from Buristan October 31, 2026 09:22
@ligurio
ligurio force-pushed the ligurio/gh-xxxx-fix-oss-fuzz-coverage branch from 33a3912 to 44682da Compare October 31, 2026 13:58
@ligurio ligurio mentioned this pull request Oct 31, 2026
34 of 39 tasks
@ligurio
ligurio force-pushed the ligurio/gh-xxxx-fix-oss-fuzz-coverage branch 3 times, most recently from 4b9fd1e to fd1b41b Compare November 2, 2026 06:07

@Buristan Buristan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sergey, thanks for the patch set!
I'll proceed with the review per-patch below.


[PATCH 1/2] luzer: move lua_rawlen compatibility shim to compat.h

LGTM, but commit length is more than 50 symbols.


[PATCH 2/2] luzer: support multiple corpus directories

LGTM, after fixing my comment below.

Comment thread luzer/luzer.c Resolved
@Buristan Buristan assigned ligurio and unassigned Buristan Nov 3, 2026
@ligurio
ligurio force-pushed the ligurio/gh-xxxx-fix-oss-fuzz-coverage branch 3 times, most recently from 6d52b65 to 668546d Compare November 3, 2026 17:21
The shim mapping lua_rawlen() to lua_objlen() for Lua 5.1 and LuaJIT
lived in custom_mutator_lib.c. Move it to compat.h so that other
translation units can use lua_rawlen() as well.
@ligurio

ligurio commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

[PATCH 1/2] luzer: move lua_rawlen compatibility shim to compat.h
LGTM, but commit length is more than 50 symbols.

Fixed.

Positional command-line arguments were all stored in a single
"corpus" flag, so each one overwrote the previous one and only the
last path reached libFuzzer. This broke merge mode (-merge=1
NEW_CORPUS OLD_CORPUS) and, as a result, corpus pruning and corpus
backups in OSS-Fuzz.

Collect positional arguments into a separate list instead of a
flag, pass it to the C implementation as the last argument, and
append it to argv after the flags, preserving the order. LibFuzzer
treats the first directory as the output one in merge mode, so the
order is significant.

Corpus directories on the command line take precedence over the
`corpus` option, as they did before multiple positional arguments
were supported; the option is used only as a fallback when no
directory is given on the command line.

Validate corpus entries before allocating argv, so that a bad
element cannot make luaL_error() longjmp past the cleanup and leak
the array.

Follows up google/oss-fuzz#14859
@ligurio
ligurio force-pushed the ligurio/gh-xxxx-fix-oss-fuzz-coverage branch from 668546d to 1577cdc Compare November 3, 2026 17:59
@ligurio
ligurio requested a review from Buristan November 3, 2026 18:17
@ligurio ligurio assigned Buristan and unassigned ligurio Nov 3, 2026

@Buristan Buristan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. LGTM.

@ligurio
ligurio merged commit 414a317 into master Nov 4, 2026
34 of 36 checks passed
@ligurio
ligurio deleted the ligurio/gh-xxxx-fix-oss-fuzz-coverage branch November 4, 2026 12:13
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.

2 participants