]> git.ipfire.org Git - thirdparty/git.git/commit - send-pack.c
always check for NULL return from packet_read_line()
authorJon Simons <jon@jonsimons.org>
Thu, 8 Feb 2018 18:47:50 +0000 (13:47 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Feb 2018 20:37:40 +0000 (12:37 -0800)
commitbb1356dc643e1488ccc1924ab674f6cbbe615f74
tree88bf6c08ac171e299567bd53df1f2820d577c691
parentbc9d4dc5b07c05c7b26a4e781b7538db7c775fc3
always check for NULL return from packet_read_line()

The packet_read_line() function will die if it sees any
protocol or socket errors. But it will return NULL for a
flush packet; some callers which are not expecting this may
dereference NULL if they get an unexpected flush. This would
involve the other side breaking protocol, but we should
flag the error rather than segfault.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote-curl.c
send-pack.c