Memory-safety fixes: uninitialized reads and a realloc leak - #613
Open
matejk wants to merge 2 commits into
Open
Conversation
matejk
force-pushed
the
fix/memory-safety
branch
from
June 17, 2026 20:35
1c27543 to
418c898
Compare
XV02
requested changes
Aug 6, 2026
XV02
left a comment
Contributor
There was a problem hiding this comment.
Thanks for all your work, just some correctness comments :DD
matejk
force-pushed
the
fix/memory-safety
branch
from
August 17, 2026 20:10
418c898 to
fcd7a4c
Compare
matejk
force-pushed
the
fix/memory-safety
branch
from
August 17, 2026 20:13
fcd7a4c to
a73c937
Compare
pews, ret in ltfs_profiler_set, cap_buf after a failed READ BUFFER, and the ICU normalize output pointer compared before its return code was checked.
matejk
force-pushed
the
fix/memory-safety
branch
2 times, most recently
from
August 17, 2026 20:28
8040315 to
18cb1e6
Compare
Contributor
Author
|
Thanks — addressed:
|
XV02
approved these changes
Aug 18, 2026
XV02
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing all my comments, LGTM! :DD
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.
Two commits:
tape_get_pewsleaves*pewsunset on-LTFS_UNSUPPORTEDwhile the caller computespews + 10;ltfs_profiler_settested an unsetretwhen the volume had neither an iosched nor a device handle;_get_dumpderived a transfer length fromcap_bufwithout checking the READ BUFFER result; the ICU normalize callers compared the output pointer against the input before checking the return code, reading uninitialized memory and potentially leaking the input buffer.reallocwas assigned straight back topriv.dk_list, so a failure overwrote the only pointer to the existing buffer with NULL and leaked it; the original pointer is now kept and freed on the error path.