Skip to content

tree.c: check that strdup() didn't fail - #740

Merged
cperciva merged 1 commit into
masterfrom
fix-unchecked-strdup
Jul 31, 2026
Merged

tree.c: check that strdup() didn't fail#740
cperciva merged 1 commit into
masterfrom
fix-unchecked-strdup

Conversation

@gperciva

Copy link
Copy Markdown
Member

No description provided.

Similar checks were added to this file in:
    2011-08-25 Tarsnap 1.0.30
    c80c7d2

Our use of tree_open() does exit gracefully if it returns NULL,
but other "could we allocate memory?" checks in tree.c use abort().
Reworking that file to have proper error paths would be a much more
invasive change.

Reported by:	chengdazhi
Bug bounty:	$10 ("harmless")
@cperciva
cperciva merged commit 08fdec1 into master Jul 31, 2026
2 checks passed
@gperciva
gperciva deleted the fix-unchecked-strdup branch July 31, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants