summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/opencdk/read-packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c
index f5b180b072..d2c420c138 100644
--- a/lib/opencdk/read-packet.c
+++ b/lib/opencdk/read-packet.c
@@ -514,7 +514,7 @@ read_attribute(cdk_stream_t inp, size_t pktlen, cdk_pkt_userid_t attr,
pktlen--;
}
- if (!len || *p != 1) { /* Currently only 1, meaning an image, is defined. */
+ if (!len || pktlen == 0 || *p != 1) { /* Currently only 1, meaning an image, is defined. */
rc = CDK_Inv_Packet;
goto error;
}