diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-02-16 14:33:22 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-16 14:33:22 -0800 |
commit | 5673d695fcce217b26d1a5956c1184ff62dc74f1 (patch) | |
tree | 1985086e66f084e2e789f8c5b5950fc18b5ba3b4 | |
parent | 43f9f053010c119c9836b2b5f8a07c72784f79b6 (diff) | |
parent | 759e84f07fd0fba2f3466b11b74146173d42cb6b (diff) | |
download | git-5673d695fcce217b26d1a5956c1184ff62dc74f1.tar.gz |
Merge branch 'maint'
* maint:
parse_tag_buffer(): do not prefixcmp() out of range
-rw-r--r-- | tag.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -97,7 +97,9 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size) item->tagged = NULL; } - if (prefixcmp(bufptr, "tag ")) + if (bufptr + 4 < tail && !prefixcmp(bufptr, "tag ")) + ; /* good */ + else return -1; bufptr += 4; nl = memchr(bufptr, '\n', tail - bufptr); @@ -106,7 +108,7 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size) item->tag = xmemdupz(bufptr, nl - bufptr); bufptr = nl + 1; - if (!prefixcmp(bufptr, "tagger ")) + if (bufptr + 7 < tail && !prefixcmp(bufptr, "tagger ")) item->date = parse_tag_date(bufptr, tail); else item->date = 0; |