bound .mat array name length in halide_debug_to_file - #9379
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
alexreinking
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.