avoid NULL argument to base64 decode

--HG--
branch : fuzz
This commit is contained in:
Matt Johnston 2017-05-25 00:09:40 +08:00
parent 3a8517b06f
commit ee5769f31f

View File

@ -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);