aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
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