Skip to content

bound .mat array name length in halide_debug_to_file - #9379

Merged
alexreinking merged 1 commit into
halide:mainfrom
Nashit-h:mat-array-name-bounds
Aug 24, 2026
Merged

bound .mat array name length in halide_debug_to_file#9379
alexreinking merged 1 commit into
halide:mainfrom
Nashit-h:mat-array-name-bounds

Conversation

@Nashit-h

Copy link
Copy Markdown
Contributor

The .mat writer in halide_debug_to_file builds an array name from the filename's base name (the text between the last slash and the extension) and copies it into a fixed char array_name[256] with no length check, so a filename whose base name is longer than 256 bytes overflows the stack buffer. Reject an oversized name before the copy, using the same halide_error_code_debug_to_file_failed return the writer already uses for oversized headers and payloads.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.90%. Comparing base (abbf7ff) to head (a657e68).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9379      +/-   ##
==========================================
- Coverage   70.14%   69.90%   -0.24%     
==========================================
  Files         260      260              
  Lines       79287    79287              
  Branches    19327    19327              
==========================================
- Hits        55617    55429     -188     
- Misses      17899    17944      +45     
- Partials     5771     5914     +143     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexreinking
alexreinking merged commit dc72fc7 into halide:main Aug 24, 2026
24 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.

2 participants