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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index bb05eabb7..caea138d3 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -229,7 +229,10 @@ sos_read (iobuf_t inp, unsigned int *ret_nread, int secure)
}
nbytes = (nbits + 7) / 8;
- buf = secure ? gcry_xmalloc_secure (nbytes) : gcry_xmalloc (nbytes);
+ if (nbytes)
+ buf = secure ? gcry_xmalloc_secure (nbytes) : gcry_xmalloc (nbytes);
+ else
+ buf = NULL;
p = buf;
for (i = 0; i < nbytes; i++)
{