changeset 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 dd5d7b7141b9
children de1d895b1cae
files signkey.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/signkey.c	Tue May 23 22:43:52 2017 +0800
+++ b/signkey.c	Thu May 25 00:09:40 2017 +0800
@@ -577,6 +577,10 @@
 
 	/* 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);