author | Jim Meyering <jim@meyering.net> | |
Fri, 4 Jan 2008 17:37:41 +0000 (18:37 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 4 Jan 2008 20:28:58 +0000 (12:28 -0800) | ||
commit | 872c930dcb048c1a2b50e6ce881c521dcee15e23 | |
tree | ccb4bc3d4d196327513108e59e3aeb76bfeeddbf | tree | snapshot |
parent | 95bf4bd4f7280312571e642339f3571310d0d660 | commit | diff |
Don't access line[-1] for a zero-length "line" from fgets.
A NUL byte at beginning of file, or just after a newline
would provoke an invalid buf[-1] access in a few places.
* builtin-grep.c (cmd_grep): Don't access buf[-1].
* builtin-pack-objects.c (get_object_list): Likewise.
* builtin-rev-list.c (read_revisions_from_stdin): Likewise.
* bundle.c (read_bundle_header): Likewise.
* server-info.c (read_pack_info_file): Likewise.
* transport.c (insert_packed_refs): Likewise.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A NUL byte at beginning of file, or just after a newline
would provoke an invalid buf[-1] access in a few places.
* builtin-grep.c (cmd_grep): Don't access buf[-1].
* builtin-pack-objects.c (get_object_list): Likewise.
* builtin-rev-list.c (read_revisions_from_stdin): Likewise.
* bundle.c (read_bundle_header): Likewise.
* server-info.c (read_pack_info_file): Likewise.
* transport.c (insert_packed_refs): Likewise.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c | diff | blob | history | |
builtin-pack-objects.c | diff | blob | history | |
builtin-rev-list.c | diff | blob | history | |
bundle.c | diff | blob | history | |
server-info.c | diff | blob | history | |
transport.c | diff | blob | history |