diff options
| author | Mischa POSLAWSKY <git@shiar.nl> | 2019-08-17 23:51:07 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-08-22 11:14:45 -0700 |
| commit | 8b3f33ef11821a6a030f789eeb0b3af01469901e (patch) | |
| tree | a710c9104ba7225ed3c27b917519fca2c2b6ed31 /ref-filter.c | |
| parent | Git 2.20.1 (diff) | |
| download | git-8b3f33ef11821a6a030f789eeb0b3af01469901e.tar.gz git-8b3f33ef11821a6a030f789eeb0b3af01469901e.zip | |
ref-filter: initialize empty name or email fields
Formatting $(taggername) on headerless tags such as v0.99 in Git
causes a SIGABRT with error "munmap_chunk(): invalid pointer",
because of an oversight in commit f0062d3b74 (ref-filter: free
item->value and item->value->s, 2018-10-19).
Signed-off-by: Mischa POSLAWSKY <git@shiar.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
| -rw-r--r-- | ref-filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ref-filter.c b/ref-filter.c index 5de616befe..3116f74225 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -976,7 +976,7 @@ static const char *copy_name(const char *buf) if (!strncmp(cp, " <", 2)) return xmemdupz(buf, cp - buf); } - return ""; + return xstrdup(""); } static const char *copy_email(const char *buf) @@ -984,10 +984,10 @@ static const char *copy_email(const char *buf) const char *email = strchr(buf, '<'); const char *eoemail; if (!email) - return ""; + return xstrdup(""); eoemail = strchr(email, '>'); if (!eoemail) - return ""; + return xstrdup(""); return xmemdupz(email, eoemail + 1 - email); } |
