From 32b4e9986d3e17e8a63a94b21c1578b01c3a3bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 29 Dec 2018 17:10:54 +0100 Subject: [PATCH] tag: tags_expand_template(): return NULL if template is NULL --- tag.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tag.c b/tag.c index 80fd00c..86b8406 100644 --- a/tag.c +++ b/tag.c @@ -399,8 +399,10 @@ sbuf_strcat(struct sbuf *s1, const char *s2) char * tags_expand_template(const char *template, const struct tag_set *tags) { - struct sbuf formatted = {0}; + if (template == NULL) + return NULL; + struct sbuf formatted = {0}; while (true) { /* Find next tag opening '{' */ const char *begin = strchr(template, '{');