Skip to content

Commit 8149f85

Browse files
authored
Merge pull request libgit2#4306 from libgit2/cmn/tag-bad-signature
signature: don't leave a dangling pointer to the strings on parse failure
2 parents c4c95bf + d1dbb3a commit 8149f85

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/signature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
231231
if (git__strtol64(&sig->when.time, time_start, &time_end, 10) < 0) {
232232
git__free(sig->name);
233233
git__free(sig->email);
234+
sig->name = sig->email = NULL;
234235
return signature_error("invalid Unix timestamp");
235236
}
236237

0 commit comments

Comments
 (0)