code-format - and afl-cmin/afl-showmap was fixed in the bugfix for afl-tmin

This commit is contained in:
van Hauser
2020-03-10 06:54:31 +01:00
parent 1467776a3f
commit 38d9aedb26
7 changed files with 36 additions and 31 deletions

View File

@ -38,7 +38,7 @@
extern u8 be_quiet;
void detect_file_args(char** argv, u8* prog_in, u8 *use_stdin) {
void detect_file_args(char** argv, u8* prog_in, u8* use_stdin) {
u32 i = 0;
#ifdef __GLIBC__
@ -58,6 +58,7 @@ void detect_file_args(char** argv, u8* prog_in, u8 *use_stdin) {
PFATAL("getcwd() failed");
}
#endif
if (!cwd) PFATAL("getcwd() failed");
@ -110,11 +111,11 @@ void detect_file_args(char** argv, u8* prog_in, u8 *use_stdin) {
/* duplicate the system argv so that
we can edit (and free!) it later */
char **argv_cpy_dup(int argc, char** argv) {
char** argv_cpy_dup(int argc, char** argv) {
u32 i = 0;
char **ret = ck_alloc((argc + 1) * sizeof(char *));
char** ret = ck_alloc((argc + 1) * sizeof(char*));
for (i = 0; i < argc; i++) {
@ -131,16 +132,19 @@ char **argv_cpy_dup(int argc, char** argv) {
/* frees all args in the given argv,
previously created by argv_cpy_dup */
void argv_cpy_free(char **argv) {
void argv_cpy_free(char** argv) {
u32 i = 0;
while (argv[i]) {
u32 i=0;
while(argv[i]) {
ck_free(argv[i]);
i++;
}
ck_free(argv);
}
}
ck_free(argv);
}
/* Rewrite argv for QEMU. */
@ -360,7 +364,7 @@ char* get_afl_env(char* env) {
if ((val = getenv(env)) != NULL)
if (!be_quiet)
OKF("Loaded environment variable %s with value %s\n", env, val);
OKF("Loaded environment variable %s with value %s", env, val);
return val;

View File

@ -135,7 +135,8 @@ void handle_timeout(int sig) {
void afl_fsrv_init(afl_forkserver_t *fsrv) {
// this structure needs default so we initialize it if this was not done already
// this structure needs default so we initialize it if this was not done
// already
if (!fsrv->use_stdin) {

View File

@ -237,7 +237,7 @@ int main(int argc, char** argv_orig, char** envp) {
struct timeval tv;
struct timezone tz;
char **argv = argv_cpy_dup(argc, argv_orig);
char** argv = argv_cpy_dup(argc, argv_orig);
afl_state_t* afl = calloc(1, sizeof(afl_state_t));
if (!afl) { FATAL("Could not create afl state"); }

View File

@ -61,7 +61,7 @@
u8 be_quiet;
char*stdin_file; /* stdin file */
char* stdin_file; /* stdin file */
u8 *in_dir, /* input folder */
*doc_path, /* Path to docs */
@ -147,7 +147,7 @@ static void at_exit_handler(void) {
/* Write results. */
static u32 write_results_to_file(afl_forkserver_t* fsrv, u8 *outfile) {
static u32 write_results_to_file(afl_forkserver_t* fsrv, u8* outfile) {
s32 fd;
u32 i, ret = 0;
@ -710,9 +710,9 @@ int main(int argc, char** argv_orig, char** envp) {
s32 opt, i;
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0, use_wine = 0;
u32 tcnt = 0;
char **use_argv;
char** use_argv;
char **argv = argv_cpy_dup(argc, argv_orig);
char** argv = argv_cpy_dup(argc, argv_orig);
afl_forkserver_t fsrv_var = {0};
afl_forkserver_t* fsrv = &fsrv_var;

View File

@ -1092,9 +1092,9 @@ int main(int argc, char** argv_orig, char** envp) {
s32 opt;
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0, use_wine = 0;
char **use_argv;
char** use_argv;
char **argv = argv_cpy_dup(argc, argv_orig);
char** argv = argv_cpy_dup(argc, argv_orig);
afl_forkserver_t fsrv_var = {0};
afl_forkserver_t* fsrv = &fsrv_var;