diff fuzzer-pubkey.c @ 1586:e6a5e51a29c9

- fuzzer-pubkey needs to free algoname, fix build - improve dictionary with lengths
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Mar 2018 21:44:09 +0800
parents cdfab509c392
children 252b406d0e9a
line wrap: on
line diff
--- a/fuzzer-pubkey.c	Sun Mar 04 19:38:34 2018 +0800
+++ b/fuzzer-pubkey.c	Sun Mar 04 21:44:09 2018 +0800
@@ -25,9 +25,9 @@
 		buffer *keyblob = buf_getstringbuf(fuzz.input);
 
 		unsigned int algolen;
-		const char* algoname = buf_getstring(keyblob, &algolen);
+		char* algoname = buf_getstring(keyblob, &algolen);
 
-		if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) {
+		if (have_algo(algoname, algolen, sshhostkey) == DROPBEAR_FAILURE) {
 			dropbear_exit("fuzzer imagined a bogus algorithm");
 		}
 		fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys",
@@ -36,6 +36,7 @@
 
 		buf_free(line);
 		buf_free(keyblob);
+		m_free(algoname);
 		m_malloc_free_epoch(1, 0);
 	} else {
 		m_malloc_free_epoch(1, 1);