Fix case of zero length continuation lines in mail parser.
authorWerner Koch <wk@gnupg.org>
Thu, 9 Apr 2015 17:17:08 +0000 (19:17 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 9 Apr 2015 17:17:08 +0000 (19:17 +0200)
commit35e68591863b7da1698ddc24d8f035fc4c382b9a
treeba72551b9cd9d73640bbc84ef0247afb9934129a
parent230930b568bb016ed13f0daa70b69922c3f4214a
Fix case of zero length continuation lines in mail parser.

* src/rfc822parse.c (parse_field): Loop after continuation line.
--

Using header lines like

  Name:[lf]
  [space][lf]
  [lf]

resulted in running into the "(s2 = strchr (delimiters2, *s)" branch
and inserting a new token for the empty continuation line.  This also
led to one byte read after the string which is what Hanno figured.
The new code should handle empty continuation lines correct.

Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from gnupg 2.1
 commit 3fbeba64a8bfb2b673230c124a3d616b6568fd2f)
src/rfc822parse.c