aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/parse-packet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index b0c6ee513..38cd8c9c8 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -2313,6 +2313,11 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
case 3:
for (i = 0; i < 8 && pktlen; i++, pktlen--)
temp[i] = iobuf_get_noeof (inp);
+ if (i < 8)
+ {
+ err = gpg_error (GPG_ERR_INV_PACKET);
+ goto leave;
+ }
memcpy (ski->s2k.salt, temp, 8);
break;
}