mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 19:08:08 +00:00
fix for afl-cc
This commit is contained in:
14
src/afl-cc.c
14
src/afl-cc.c
@ -114,10 +114,10 @@ u8 *getthecwd() {
|
|||||||
1. if obj_path is already set we look there first
|
1. if obj_path is already set we look there first
|
||||||
2. then we check the $AFL_PATH environment variable location if set
|
2. then we check the $AFL_PATH environment variable location if set
|
||||||
3. next we check argv[0] if has path information and use it
|
3. next we check argv[0] if has path information and use it
|
||||||
a) we also check ../lib/
|
a) we also check ../lib/afl
|
||||||
4. if 3. failed we check /proc (only Linux, Android, NetBSD, DragonFly, and
|
4. if 3. failed we check /proc (only Linux, Android, NetBSD, DragonFly, and
|
||||||
FreeBSD with procfs
|
FreeBSD with procfs
|
||||||
a) and check here in ../lib/ too
|
a) and check here in ../lib/afl too
|
||||||
5. we look into the AFL_PATH define (usually /usr/local/lib/afl)
|
5. we look into the AFL_PATH define (usually /usr/local/lib/afl)
|
||||||
6. we finally try the current directory
|
6. we finally try the current directory
|
||||||
|
|
||||||
@ -175,11 +175,11 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ck_free(tmp);
|
ck_free(tmp);
|
||||||
tmp = alloc_printf("%s/../lib/%s", dir, obj);
|
tmp = alloc_printf("%s/../lib/afl/%s", dir, obj);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
u8 *dir2 = alloc_printf("%s/../lib", dir);
|
u8 *dir2 = alloc_printf("%s/../lib/afl", dir);
|
||||||
obj_path = dir2;
|
obj_path = dir2;
|
||||||
ck_free(dir);
|
ck_free(dir);
|
||||||
return tmp;
|
return tmp;
|
||||||
@ -215,18 +215,18 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
u8 *dir = alloc_printf("%s/../lib/", exepath);
|
u8 *dir = alloc_printf("%s", exepath);
|
||||||
obj_path = dir;
|
obj_path = dir;
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ck_free(tmp);
|
ck_free(tmp);
|
||||||
tmp = alloc_printf("%s/../lib/%s", exepath, obj);
|
tmp = alloc_printf("%s/../lib/afl/%s", exepath, obj);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
u8 *dir = alloc_printf("%s/../lib/", exepath);
|
u8 *dir = alloc_printf("%s/../lib/afl/", exepath);
|
||||||
obj_path = dir;
|
obj_path = dir;
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user