aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-06-18 08:08:49 +0000
committerWerner Koch <[email protected]>2010-06-18 08:08:49 +0000
commit5eb6899f3e30ff2f687674375dca3e4586b98b97 (patch)
tree1414243776a7de4262853d8f39c60712e97b9639
parentMake CAST5 the default s2k algo tomatch the doc and gpg 1.4. (diff)
downloadgnupg-5eb6899f3e30ff2f687674375dca3e4586b98b97.tar.gz
gnupg-5eb6899f3e30ff2f687674375dca3e4586b98b97.zip
Backport bug fix. Fixes bug#1240.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/parse-packet.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index cbe1a182e..4df669496 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-18 Werner Koch <[email protected]>
+
+ * parse-packet.c (skip_packet, parse_gpg_control): Take care of
+ premature EOFs. Backport from trunk.
+
2010-06-17 Werner Koch <[email protected]>
* gpg.c (main): Use CAST5 as default s2k algo. The macro
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 16ca7514f..bbd58085d 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -682,7 +682,11 @@ skip_packet( IOBUF inp, int pkttype, unsigned long pktlen, int partial )
else
{
for( ; pktlen; pktlen-- )
- dump_hex_line(iobuf_get(inp), &i);
+ {
+ dump_hex_line ((c=iobuf_get(inp)), &i);
+ if (c == -1)
+ break;
+ }
}
putc ('\n', listfp);
return;
@@ -2529,7 +2533,11 @@ parse_gpg_control (IOBUF inp, int pkttype, unsigned long pktlen,
}
else {
for( ; pktlen; pktlen-- )
- dump_hex_line(iobuf_get(inp), &i);
+ {
+ dump_hex_line ((c=iobuf_get (inp)), &i);
+ if (c == -1)
+ break;
+ }
}
putc ('\n', listfp);
}