gpg: Stop early on bogus old style comment packets.

* g10/parse-packet.c (parse_key): Take care of too short packets for
old style commet packets.
--

GnuPG-bug-id: 1714
This commit is contained in:
Werner Koch 2014-09-11 16:40:45 +02:00
parent 84419f42da
commit 3d250d21d3
1 changed files with 3 additions and 1 deletions

View File

@ -1978,7 +1978,9 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
for (; pktlen; pktlen--)
{
int c;
c = iobuf_get_noeof (inp);
c = iobuf_get (inp);
if (c == -1)
break; /* Ooops: shorter than indicated. */
if (c >= ' ' && c <= 'z')
es_putc (c, listfp);
else