Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
fetch-pack: fix out-of-bounds buffer offset in get_ack
[gitweb.git]
/
fetch-pack.c
diff --git
a/fetch-pack.c
b/fetch-pack.c
index 6d8926a5504a6cd93e19860f85d58816bdd5c222..27a3e8036474eb18501a79a053bcba84317f52fe 100644
(file)
--- a/
fetch-pack.c
+++ b/
fetch-pack.c
@@
-226,6
+226,8
@@
static enum ack_type get_ack(int fd, unsigned char *result_sha1)
return NAK;
if (!prefixcmp(line, "ACK ")) {
if (!get_sha1_hex(line+4, result_sha1)) {
+ if (len < 45)
+ return ACK;
if (strstr(line+45, "continue"))
return ACK_continue;
if (strstr(line+45, "common"))