diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-27 10:33:54 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-27 10:33:55 -0800 |
commit | 2fb346c06a0160cac185ad57368c04c17c2578ac (patch) | |
tree | 2574f86d599946d9a364f3103578696013091f15 /remote-curl.c | |
parent | 8b49408421bba8a928c207991bc197a226b65782 (diff) | |
parent | bb1356dc643e1488ccc1924ab674f6cbbe615f74 (diff) | |
download | git-2fb346c06a0160cac185ad57368c04c17c2578ac.tar.gz |
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 'remote-curl.c')
-rw-r--r-- | remote-curl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c index 6ec5352435..e11e619d0d 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -351,6 +351,8 @@ static struct discovery *discover_refs(const char *service, int for_push) * pkt-line matches our request. */ line = packet_read_line_buf(&last->buf, &last->len, NULL); + if (!line) + die("invalid server response; expected service, got flush packet"); strbuf_reset(&exp); strbuf_addf(&exp, "# service=%s", service); |