gpgparsemail: Fix case of zero length continuation lines.
authorWerner Koch <wk@gnupg.org>
Thu, 9 Apr 2015 17:06:33 +0000 (19:06 +0200)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 15 Apr 2015 07:07:56 +0000 (16:07 +0900)
commitde7f7b98dfeb30675369d0bedc6d639314193e96
tree3f306fa58bd4c0da20d05241976e341b0e4e4cf1
parenta838e8f806693e9403541f482b58b66c606e376b
gpgparsemail: Fix case of zero length continuation lines.

* tools/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 2.1 commit 3fbeba64a8bfb2b673230c124a3d616b6568fd2f)
tools/rfc822parse.c