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()
This commit is contained in:
Junio C Hamano
2018-02-27 10:33:54 -08:00
4 changed files with 7 additions and 3 deletions

View File

@ -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);