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