aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-09-11 14:40:45 +0000
committerWerner Koch <[email protected]>2014-09-11 14:40:45 +0000
commit3d250d21d36e8a0935b645f1ed5134ef9083530e (patch)
tree8dbac0fbb7a5b914cd97b0bb0a53830aa3e9cdcd /g10/parse-packet.c
parentdirmngr: Support https for KS_FETCH. (diff)
downloadgnupg-3d250d21d36e8a0935b645f1ed5134ef9083530e.tar.gz
gnupg-3d250d21d36e8a0935b645f1ed5134ef9083530e.zip
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
Diffstat (limited to 'g10/parse-packet.c')
-rw-r--r--g10/parse-packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index cfae788d5..edaa84da4 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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