Commit Diff
--- parser.c +++ parser.c @@ -137,6 +137,9 @@ parser_append(struct buffer *b, const char *buf, size_ size_t newlen; char *t; + if (len == 0) + return (1); + newlen = len + b->len; t = xcalloc(1, newlen); memcpy(t, b->buf, b->len);
--- parser.c +++ parser.c @@ -137,6 +137,9 @@ parser_append(struct buffer *b, const char *buf, size_ size_t newlen; char *t; + if (len == 0) + return (1); + newlen = len + b->len; t = xcalloc(1, newlen); memcpy(t, b->buf, b->len);