Skip to content

signature: don't leave a dangling pointer to the strings on parse failure#4306

Merged
pks-t merged 1 commit intomasterfrom
cmn/tag-bad-signature
Jul 14, 2017
Merged

signature: don't leave a dangling pointer to the strings on parse failure#4306
pks-t merged 1 commit intomasterfrom
cmn/tag-bad-signature

Conversation

@carlosmn
Copy link
Copy Markdown
Member

If the signature is invalid but we detect that after allocating the strings, we
free them. We however leave that pointer dangling in the structure the caller
gave us, which can lead to double-free.

Set these pointers to NULL after freeing their memory to avoid this.

…lure

If the signature is invalid but we detect that after allocating the strings, we
free them. We however leave that pointer dangling in the structure the caller
gave us, which can lead to double-free.

Set these pointers to `NULL` after freeing their memory to avoid this.
@pks-t pks-t merged commit 8149f85 into master Jul 14, 2017
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Jul 14, 2017

Looks obviously correct! Test failures were (yet again) unrelated. 👍

@pks-t pks-t added the backport label Jan 11, 2018
@pks-t pks-t mentioned this pull request Jan 12, 2018
@ethomson ethomson deleted the cmn/tag-bad-signature branch January 9, 2019 10:20
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