summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-27 18:33:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-27 18:33:55 (GMT)
commit2fb346c06a0160cac185ad57368c04c17c2578ac (patch)
tree2574f86d599946d9a364f3103578696013091f15 /fetch-pack.c
parent8b49408421bba8a928c207991bc197a226b65782 (diff)
parentbb1356dc643e1488ccc1924ab674f6cbbe615f74 (diff)
downloadgit-2fb346c06a0160cac185ad57368c04c17c2578ac.zip
git-2fb346c06a0160cac185ad57368c04c17c2578ac.tar.gz
git-2fb346c06a0160cac185ad57368c04c17c2578ac.tar.bz2
Merge branch 'js/packet-read-line-check-null'
Some low level protocol codepath could crash when they get an unexpected flush packet, which is now fixed. * js/packet-read-line-check-null: always check for NULL return from packet_read_line() correct error messages for NULL packet_read_line()
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 8253d74..d974612 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -261,8 +261,8 @@ static enum ack_type get_ack(int fd, struct object_id *result_oid)
char *line = packet_read_line(fd, &len);
const char *arg;
- if (!len)
- die(_("git fetch-pack: expected ACK/NAK, got EOF"));
+ if (!line)
+ die(_("git fetch-pack: expected ACK/NAK, got a flush packet"));
if (!strcmp(line, "NAK"))
return NAK;
if (skip_prefix(line, "ACK ", &arg)) {