Skip to content

fix(ipc): Return EINVAL from ArrowIpcDecoderDecodeFooter when the footer has no schema - #1023

Merged
paleolimbot merged 1 commit into
apache:mainfrom
shashank11yadav:fix/decode-footer-no-schema
Nov 17, 2026
Merged

paleolimbot merged 1 commit into
apache:mainfrom
shashank11yadav:fix/decode-footer-no-schema

Conversation

@shashank11yadav

Copy link
Copy Markdown
Contributor

Fixes #1022

ArrowIpcDecoderDecodeFooter() reads fields from the footer's schema table without checking that the footer has one. A footer without the optional schema field aborts in a Debug build.

This adds the same check that ArrowIpcDecoderVerifyFooter() already has: when the footer has no schema, it sets the error message "Footer has no schema" and returns EINVAL. The public header says DecodeFooter returns EINVAL when the footer cannot be decoded.

Test: adds NanoarrowIpcTest.NanoarrowIpcFooterMissingSchema in src/nanoarrow/ipc/decoder_test.cc. It uses a 22-byte footer with no schema and checks that both VerifyFooter and DecodeFooter return EINVAL with that message.

How it was tested:

  • The new test passes with the fix and fails without it.
  • The full test suite passed: 431 tests, 16 tests skipped.
  • The clang-format check on the two changed files passed.

Checklist:

  • Tests added for the change
  • Lint (pre-commit hooks) passed on all files. Not run: the hooks need network access to fetch their repositories, which the test environment does not have. The clang-format check above covers only the two changed files.

…ter has no schema

DecodeFooter now checks for a missing schema the same way VerifyFooter
does, instead of reading fields from a NULL schema table.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.61%. Comparing base (1292ac0) to head (09473cc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1023      +/-   ##
==========================================
+ Coverage   78.59%   78.61%   +0.02%     
==========================================
  Files         106      106              
  Lines       17328    17331       +3     
  Branches     2067     2068       +1     
==========================================
+ Hits        13619    13625       +6     
+ Misses       2446     2444       -2     
+ Partials     1263     1262       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paleolimbot paleolimbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@paleolimbot
paleolimbot merged commit b7a56da into apache:main Nov 17, 2026
44 checks 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.

ArrowIpcDecoderDecodeFooter() crashes on a footer with no schema instead of returning EINVAL

3 participants