shithub: fuzz

Download patch

ref: e34b47e597b95ac898f7ec90dd3c56ea2ad63cb7
parent: d81c60b6c13d3eb4860b57e2aec26dfe2cbd8337
author: glenda <glenda@10.0.2.15>
date: Sat Nov 24 15:54:36 EST 2018

fix name table for types ;; clean up logging

--- a/fuzz.h
+++ b/fuzz.h
@@ -8,7 +8,7 @@
 
 // Number of calls in enum calls
 #define NCALLS 68
-#define NTYPES 5
+#define NTYPES 16
 
 // Global variables
 // In main.c
--- a/input.c
+++ b/input.c
@@ -1027,45 +1027,46 @@
 	for (x = 0; x < (sc->inputs.size); x++) {
 		t_type* ele = lget(&(sc->inputs), x);
 
-		dolog("\t\t%s : ", callnames[ele->t]);
+		dolog("\t\t%s : ", typenames[ele->t]);
 
 		switch(ele->t) {
 			case t_int :
-				dolog("t_int: %d\n", *(int*) ele->var);
+				dolog("%d\n", *(int*) ele->var);
 				break;
 			case t_uint :
-				dolog("t_uint: %d\n", *(unsigned int*) ele->var);
+				dolog("%d\n", *(unsigned int*) ele->var);
 				break;
 			case t_long :
-				dolog("t_long: %ld\n", *(long*) ele->var);
+				dolog("%ld\n", *(long*) ele->var);
 				break;
 			case t_ulong :
-				dolog("t_ulong: %lud\n", *(unsigned long*) ele->var);
+				dolog("%lud\n", *(unsigned long*) ele->var);
 				break;
 			case t_vlong :
-				dolog("t_vlong: %lld\n", *(long long*) ele->var);
+				dolog("%lld\n", *(long long*) ele->var);
 				break;
 			case t_longS :
-				dolog("t_longS: %ld\n", *(long*) ele->var);
+				dolog("%ld\n", *(long*) ele->var);
 				break;
 			case t_DirS :  //TODO : verify that this works; compiler warns against
-				// dolog("t_DirS: %s\n", (Dir*) ele->var);
+				// It doesn't, Dir* is a pointer to a struct Dir; see libc.h:621
+				// dolog("%s\n", (Dir*) ele->var);
 				break;
 			case t_charS :
 				// TODO -- segfaults
-				// dolog("t_charS: %s\n", *(char**) ele->var);
+				// dolog("%s\n", *(char**) ele->var);
 				break;
 			case t_charSArr :
-				//dolog("t_charSArr: %s\n", (char**) ele->var);
+				//dolog("%s\n", (char**) ele->var);
 				break;
 			case t_char :
-				dolog("t_char: %c\n", *(char*) ele->var);
+				dolog("%c\n", *(char*) ele->var);
 				break;
 			case t_uchar :
-				dolog("t_uchar: %c\n", *(unsigned char*) ele->var);
+				dolog("%c\n", *(unsigned char*) ele->var);
 				break;
 			case t_void:
-				dolog("void: skipping over…\n");
+				dolog("skipping over…\n");
 				break;
 			default :
 				fprint(2, "Error: Encountered unknown input variable type!\n");
@@ -1153,7 +1154,7 @@
 "getppid",
 "rerrstr",
 "sysname",
-"werrstr",
+"werrstr"
 };
 
 // Init callnames here, is extern in fuzz.h
@@ -1160,7 +1161,19 @@
 char *typenames[NTYPES]= {
 "int",
 "int*",
+"uint",
+"IOchunk*",
 "long",
+"long*",
+"ulong",
+"vlong",
 "Dir*",
-"char*"
+"Dir**",
+"char"
+"uchar",
+"uchar*",
+"char*",
+"char*[]",
+"void",
+"void*"
 };
--- a/main.c
+++ b/main.c
@@ -88,7 +88,7 @@
 	// save so we don't have two different time(0)'s
 	int fuzz_seed = time(0);
 	srand(fuzz_seed);
-	dolog("==Seed Value: %d==\n", fuzz_seed);
+	dolog("== Seed Value: %d ==\n", fuzz_seed);
 
 	// Operate for the desired number of rounds, -1 is infinite
 	for(i = 0; i < nrounds || nrounds < 0; i++){