Mercurial > dropbear
comparison signkey.c @ 1371:bc9e2e148f58 fuzz
avoid NULL argument to base64 decode
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 May 2017 00:09:40 +0800 |
parents | ddfcadca3c4c |
children | 616417b27f55 |
comparison
equal
deleted
inserted
replaced
1370:dd5d7b7141b9 | 1371:bc9e2e148f58 |
---|---|
575 unsigned long decodekeylen; | 575 unsigned long decodekeylen; |
576 unsigned char* filealgo = NULL; | 576 unsigned char* filealgo = NULL; |
577 | 577 |
578 /* now we have the actual data */ | 578 /* now we have the actual data */ |
579 len = line->len - line->pos; | 579 len = line->len - line->pos; |
580 if (len == 0) { | |
581 /* base64_decode doesn't like NULL argument */ | |
582 return DROPBEAR_FAILURE; | |
583 } | |
580 decodekeylen = len * 2; /* big to be safe */ | 584 decodekeylen = len * 2; /* big to be safe */ |
581 decodekey = buf_new(decodekeylen); | 585 decodekey = buf_new(decodekeylen); |
582 | 586 |
583 if (base64_decode(buf_getptr(line, len), len, | 587 if (base64_decode(buf_getptr(line, len), len, |
584 buf_getwriteptr(decodekey, decodekey->size), | 588 buf_getwriteptr(decodekey, decodekey->size), |