mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 19:08:08 +00:00
quickfix for first big bug that use_stdin was not correctly initialized and could not be set
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
#include "types.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
void detect_file_args(char** argv, u8* prog_in, u8 use_stdin);
|
||||
void detect_file_args(char** argv, u8* prog_in, u8 *use_stdin);
|
||||
void check_environment_vars(char** env);
|
||||
|
||||
char** get_qemu_argv(u8* own_loc, u8** target_path_p, int argc, char** argv);
|
||||
|
@ -1009,7 +1009,7 @@ int main(int argc, char** argv, char** envp) {
|
||||
set_up_environment();
|
||||
|
||||
find_binary(argv[optind]);
|
||||
detect_file_args(argv + optind, prog_in, use_stdin);
|
||||
detect_file_args(argv + optind, prog_in, &use_stdin);
|
||||
|
||||
if (qemu_mode) {
|
||||
|
||||
|
@ -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__
|
||||
@ -149,7 +149,7 @@ char **create_file_args(int argc, char** argv, u8* prog_in, u8 use_stdin) {
|
||||
|
||||
if (!prog_in) FATAL("@@ syntax is not supported by this tool.");
|
||||
|
||||
use_stdin = 0;
|
||||
*use_stdin = 0;
|
||||
|
||||
if (prog_in[0] != 0) { // not afl-showmap special case
|
||||
|
||||
|
@ -135,6 +135,15 @@ void handle_timeout(int sig) {
|
||||
|
||||
void afl_fsrv_init(afl_forkserver_t *fsrv) {
|
||||
|
||||
uint32_t i, j = 0;
|
||||
|
||||
// this is the default and is != 0 so we need to set it if fsrv is still
|
||||
// uninitialized
|
||||
for (i = 0; i < sizeof(afl_forkserver_t) && j == 0; i++)
|
||||
if (((char*)fsrv)[i] != 0)
|
||||
j = 1;
|
||||
if (j == 0)
|
||||
fsrv->use_stdin = 1;
|
||||
list_append(&fsrv_list, fsrv);
|
||||
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ int main(int argc, char** argv, char** envp) {
|
||||
}
|
||||
|
||||
detect_file_args(argv + optind + 1, afl->fsrv.out_file,
|
||||
afl->fsrv.use_stdin);
|
||||
&afl->fsrv.use_stdin);
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -899,11 +899,11 @@ int main(int argc, char** argv, char** envp) {
|
||||
if (in_dir) {
|
||||
|
||||
if (at_file) PFATAL("Options -A and -i are mutually exclusive");
|
||||
detect_file_args(argv + optind, "", fsrv->use_stdin);
|
||||
detect_file_args(argv + optind, "", &fsrv->use_stdin);
|
||||
|
||||
} else {
|
||||
|
||||
detect_file_args(argv + optind, at_file, fsrv->use_stdin);
|
||||
detect_file_args(argv + optind, at_file, &fsrv->use_stdin);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1274,7 +1274,7 @@ int main(int argc, char** argv, char** envp) {
|
||||
set_up_environment(fsrv);
|
||||
|
||||
find_binary(fsrv, argv[optind]);
|
||||
detect_file_args(argv + optind, fsrv->out_file, fsrv->use_stdin);
|
||||
detect_file_args(argv + optind, fsrv->out_file, &fsrv->use_stdin);
|
||||
|
||||
if (qemu_mode) {
|
||||
|
||||
|
Reference in New Issue
Block a user