author | Junio C Hamano <junkio@cox.net> | |
Fri, 26 May 2006 07:46:58 +0000 (00:46 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 26 May 2006 07:49:36 +0000 (00:49 -0700) | ||
commit | ef29c11702594e616cf43bea260515d9f14f17b0 | |
tree | 6334bff1bd9de619037858439b8abbd16569ab0f | tree | snapshot |
parent | 2dec02b1ecafc47d4031d0a68a94c775a6a9ff9e | commit | diff |
mailinfo: More carefully parse header lines in read_one_header_line()
We exited prematurely from header parsing loop when the header
field did not have a space after the colon but we insisted on
it, and we got the check wrong because we forgot that we strip
the trailing whitespace before we do the check.
The space after the colon is not even required by RFC2822, so
stop requiring it. While we are at it, the header line is
specified to be more strict than "anything with a colon in it"
(there must be one or more characters before the colon, and they
must not be controls, SP or non US-ASCII), so implement that
check as well, lest we mistakenly think something like:
Bogus not a header line: this is not.
as a header line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
We exited prematurely from header parsing loop when the header
field did not have a space after the colon but we insisted on
it, and we got the check wrong because we forgot that we strip
the trailing whitespace before we do the check.
The space after the colon is not even required by RFC2822, so
stop requiring it. While we are at it, the header line is
specified to be more strict than "anything with a colon in it"
(there must be one or more characters before the colon, and they
must not be controls, SP or non US-ASCII), so implement that
check as well, lest we mistakenly think something like:
Bogus not a header line: this is not.
as a header line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
mailinfo.c | diff | blob | history |