author | Jim Meyering <jim@meyering.net> | |
Thu, 26 May 2011 13:54:18 +0000 (15:54 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 26 May 2011 18:07:52 +0000 (11:07 -0700) | ||
commit | 5743350f696745a48dfe7976c98dc8eb5c842d72 | |
tree | 25de41a88ebaa9217b2493d1b0eca7aa88ef8acb | tree | snapshot |
parent | bac9c06ba093d9254cb2ab3eed074722a3e635a6 | commit | diff |
rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
If we reach EOF after the SHA1-then-TAB, yet before the NUL that
terminates each file name, we would fill the file name buffer with \255
bytes resulting from the repeatedly-failing fgetc (returns EOF/-1) and
ultimately complain about "filename too long", because no NUL was
encountered.
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If we reach EOF after the SHA1-then-TAB, yet before the NUL that
terminates each file name, we would fill the file name buffer with \255
bytes resulting from the repeatedly-failing fgetc (returns EOF/-1) and
ultimately complain about "filename too long", because no NUL was
encountered.
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c | diff | blob | history |