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:
@ -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)) {
|
||||
|
Reference in New Issue
Block a user