-rw-r--r-- | parsing.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -217,13 +217,13 @@ struct taginfo *cgit_parse_tag(struct tag *tag) ret->tagger_email = NULL; ret->tagger_date = 0; ret->msg = NULL; p = data; - while (p) { + while (p && *p) { if (*p == '\n') break; if (!strncmp(p, "tagger ", 7)) { p += 7; t = strchr(p, '<') - 1; @@ -235,11 +235,11 @@ struct taginfo *cgit_parse_tag(struct tag *tag) } p = strchr(p, '\n') + 1; } while (p && (*p == '\n')) p = strchr(p, '\n') + 1; - if (p) + if (p && *p) ret->msg = xstrdup(p); free(data); return ret; } |