summaryrefslogtreecommitdiffhomepage
path: root/signkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-05-25 00:09:40 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-05-25 00:09:40 +0800
commitee5769f31fc5bef0c0f5f6977523918af892fa3b (patch)
treed263671261b31b182902c899cc972f6693376948 /signkey.c
parent3a8517b06fa64c2052e182733dd1b319566a2315 (diff)
avoid NULL argument to base64 decode
--HG-- branch : fuzz
Diffstat (limited to 'signkey.c')
-rw-r--r--signkey.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/signkey.c b/signkey.c
index 3d78e35..19a2c08 100644
--- a/signkey.c
+++ b/signkey.c
@@ -577,6 +577,10 @@ int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen,
/* now we have the actual data */
len = line->len - line->pos;
+ if (len == 0) {
+ /* base64_decode doesn't like NULL argument */
+ return DROPBEAR_FAILURE;
+ }
decodekeylen = len * 2; /* big to be safe */
decodekey = buf_new(decodekeylen);