mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
more small fixes
This commit is contained in:
@ -108,7 +108,6 @@ void pmparser_print(procmaps_struct *map, int order);
|
|||||||
|
|
||||||
procmaps_iterator *pmparser_parse(int pid) {
|
procmaps_iterator *pmparser_parse(int pid) {
|
||||||
|
|
||||||
procmaps_iterator *maps_it = malloc(sizeof(procmaps_iterator));
|
|
||||||
char maps_path[500];
|
char maps_path[500];
|
||||||
if (pid >= 0) {
|
if (pid >= 0) {
|
||||||
|
|
||||||
@ -129,6 +128,7 @@ procmaps_iterator *pmparser_parse(int pid) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
procmaps_iterator *maps_it = malloc(sizeof(procmaps_iterator));
|
||||||
int ind = 0;
|
int ind = 0;
|
||||||
char buf[PROCMAPS_LINE_MAX_LENGTH];
|
char buf[PROCMAPS_LINE_MAX_LENGTH];
|
||||||
// int c;
|
// int c;
|
||||||
|
Submodule qemu_mode/qemuafl deleted from d66c9e2654
@ -342,7 +342,7 @@ u8 *find_binary(u8 *fname) {
|
|||||||
if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
|
if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
|
||||||
!(st.st_mode & 0111) || st.st_size < 4) {
|
!(st.st_mode & 0111) || st.st_size < 4) {
|
||||||
|
|
||||||
free(target_path);
|
ck_free(target_path);
|
||||||
FATAL("Program '%s' not found or not executable", fname);
|
FATAL("Program '%s' not found or not executable", fname);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -214,6 +214,7 @@ static py_mutator_t *init_py_module(afl_state_t *afl, u8 *module_name) {
|
|||||||
|
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
fprintf(stderr, "Failed to load \"%s\"\n", module_name);
|
fprintf(stderr, "Failed to load \"%s\"\n", module_name);
|
||||||
|
free(py);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Written by Nathan Voss <njvoss99@gmail.com>
|
* Written by Nathan Voss <njvoss99@gmail.com>
|
||||||
* Adapted by Lukas Seidel <seidel.1@campus.tu-berlin.de>
|
* Adapted by Lukas Seidel <seidel.1@campus.tu-berlin.de>
|
||||||
*/
|
*/
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
if(argc < 2){
|
if(argc < 2){
|
||||||
@ -19,15 +19,19 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
char *data_buf = argv[1];
|
char *data_buf = argv[1];
|
||||||
|
|
||||||
if len(data_buf < 20) {
|
if (strlen(data_buf) >= 21 && data_buf[20] != 0) {
|
||||||
if (data_buf[20] != 0) {
|
|
||||||
printf("Not crashing");
|
printf("Not crashing");
|
||||||
} else if (data_buf[0] > 0x10 && data_buf[0] < 0x20 && data_buf[1] > data_buf[2]) {
|
} else if (strlen(data_buf) > 1
|
||||||
|
&& data_buf[0] > 0x10 && data_buf[0] < 0x20 && data_buf[1] > data_buf[2]) {
|
||||||
printf("Also not crashing with databuf[0] == %c", data_buf[0])
|
printf("Also not crashing with databuf[0] == %c", data_buf[0])
|
||||||
} else if (data_buf[9] == 0x00 && data_buf[10] != 0x00 && data_buf[11] == 0x00) {
|
}
|
||||||
|
#if 0
|
||||||
|
// not possible with argv (zero terminated strings) (hexcoder-)
|
||||||
|
// do not try to access data_buf[10] and beyond
|
||||||
|
else if (data_buf[9] == 0x00 && data_buf[10] != 0x00 && data_buf[11] == 0x00) {
|
||||||
// Cause a crash if data[10] is not zero, but [9] and [11] are zero
|
// Cause a crash if data[10] is not zero, but [9] and [11] are zero
|
||||||
unsigned char invalid_read = *(unsigned char *) 0x00000000;
|
unsigned char invalid_read = *(unsigned char *) 0x00000000;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user