Skip to content

Fix #27096 - Do not sort a wasm section vector that failed to parse or is empty ##bin - #27118

Merged
trufae merged 1 commit into
radareorg:masterfrom
HuzaifaChaudary:wasm-empty-vec-sort
Oct 22, 2026
Merged

trufae merged 1 commit into
radareorg:masterfrom
HuzaifaChaudary:wasm-empty-vec-sort

Conversation

@HuzaifaChaudary

Copy link
Copy Markdown
Contributor
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the book (optional)

Description

parse_vec returns NULL when a section has no entries , and parse_sub_section_vec then sorted that NULL vector , so the reproducer from #27096 , an export section with count 0 , aborted with assertions on and printed a warning without them . the sort is skipped when there is nothing to sort .

the new r2r test writes the same 11 bytes into malloc:// and loads them with oba , so no binary fixture is needed . it fails before the change , the assertion aborts , and passes after . db/formats/web_assembly 10 OK , db/anal/wasm 22 OK , db/cmd/cmd_iw 21 OK . rabin2 -I and rabin2 -e on the reproducer exit 0 with R2_DEBUG_ASSERT=1 .

Copilot AI balanced review requested due to automatic review settings October 21, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trufae
trufae merged commit d752456 into radareorg:master Oct 22, 2026
1 check passed
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.

3 participants