git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] ref-filter: initialize empty name or email fields
@ 2019-08-17 21:51 Mischa POSLAWSKY
  2019-08-19 17:55 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Mischa POSLAWSKY @ 2019-08-17 21:51 UTC (permalink / raw)
  To: git,
	Оля Тележная
  Cc: Junio C Hamano

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>
---
If I understand correctly, such tags cannot be produced normally anymore.
Therefore I'm unsure how to make tests, and if that is even warranted.

 ref-filter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ref-filter.c b/ref-filter.c
index f27cfc8c3e..7338cfc671 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1028,7 +1028,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)
@@ -1036,10 +1036,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);
 }
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-08-22 18:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17 21:51 [PATCH] ref-filter: initialize empty name or email fields Mischa POSLAWSKY
2019-08-19 17:55 ` Junio C Hamano
2019-08-20 16:37   ` Junio C Hamano
2019-08-22 13:23     ` Mischa POSLAWSKY
2019-08-21 21:57   ` Junio C Hamano
2019-08-22 13:55     ` [PATCH 2/1] t6300: format missing tagger Mischa POSLAWSKY
2019-08-22 16:15       ` Junio C Hamano
2019-08-22 16:27         ` Mischa POSLAWSKY
2019-08-22 18:05           ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).