zyw-200 / FirmAFL

FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware.
GNU General Public License v3.0
438 stars 91 forks source link

QEMU crashed(segmentation fault) when start_fork_pc is absent in FirmAFL_config #40

Open hcx1chzh opened 3 years ago

hcx1chzh commented 3 years ago

I've tested TL-WR940N(US)_V4 using config from FirmAFL_config/105600. But qemu-system-mips(compiled from qemu_mode/DECAF_qemu_2.10) crashed at qemu_mode/DECAF_qemu_2.10/accel/tcg/cpu-exec.c void getconfig(char, char) when searching for "start_fork_pc"(which is absent in FirmAFL_config file). It seems that when fp comes to the end of the file, feof returns non-zero and fgets returns NULL, which results in failure in strtok(NULL, "=") and strlen(value=NULL). So should I add start_fork_pc in config for FEED_HTTP type or just check whether fgets returns NULL?