mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-17 20:28:08 +00:00
fix afl-cc library search
This commit is contained in:
29
src/afl-cc.c
29
src/afl-cc.c
@ -130,20 +130,27 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
u8 *afl_path = getenv("AFL_PATH");
|
u8 *afl_path = getenv("AFL_PATH");
|
||||||
u8 *slash = NULL, *tmp;
|
u8 *slash = NULL, *tmp;
|
||||||
|
|
||||||
if (obj_path) {
|
/*
|
||||||
|
if (obj_path) {
|
||||||
|
|
||||||
tmp = alloc_printf("%s/%s", obj_path, obj);
|
tmp = alloc_printf("%s/%s", obj_path, obj);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) { return tmp; }
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
ck_free(tmp);
|
if (!access(tmp, R_OK)) { return tmp; }
|
||||||
|
|
||||||
}
|
ck_free(tmp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
if (afl_path) {
|
if (afl_path) {
|
||||||
|
|
||||||
tmp = alloc_printf("%s/%s", afl_path, obj);
|
tmp = alloc_printf("%s/%s", afl_path, obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
obj_path = afl_path;
|
obj_path = afl_path;
|
||||||
@ -168,6 +175,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
|
|
||||||
tmp = alloc_printf("%s/%s", dir, obj);
|
tmp = alloc_printf("%s/%s", dir, obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
obj_path = dir;
|
obj_path = dir;
|
||||||
@ -178,6 +187,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
ck_free(tmp);
|
ck_free(tmp);
|
||||||
tmp = alloc_printf("%s/../lib/afl/%s", dir, obj);
|
tmp = alloc_printf("%s/../lib/afl/%s", dir, obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
u8 *dir2 = alloc_printf("%s/../lib/afl", dir);
|
u8 *dir2 = alloc_printf("%s/../lib/afl", dir);
|
||||||
@ -232,6 +243,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
ck_free(tmp);
|
ck_free(tmp);
|
||||||
tmp = alloc_printf("%s/../lib/afl/%s", exepath, obj);
|
tmp = alloc_printf("%s/../lib/afl/%s", exepath, obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
u8 *dir = alloc_printf("%s/../lib/afl/", exepath);
|
u8 *dir = alloc_printf("%s/../lib/afl/", exepath);
|
||||||
@ -255,6 +268,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
|
|
||||||
tmp = alloc_printf("%s/%s", AFL_PATH, obj);
|
tmp = alloc_printf("%s/%s", AFL_PATH, obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
obj_path = AFL_PATH;
|
obj_path = AFL_PATH;
|
||||||
@ -266,6 +281,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
|
|
||||||
tmp = alloc_printf("./%s", obj);
|
tmp = alloc_printf("./%s", obj);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying %s\n", tmp);
|
||||||
|
|
||||||
if (!access(tmp, R_OK)) {
|
if (!access(tmp, R_OK)) {
|
||||||
|
|
||||||
obj_path = ".";
|
obj_path = ".";
|
||||||
@ -275,6 +292,8 @@ static u8 *find_object(u8 *obj, u8 *argv0) {
|
|||||||
|
|
||||||
ck_free(tmp);
|
ck_free(tmp);
|
||||||
|
|
||||||
|
if (debug) DEBUGF("Trying ... giving up\n");
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user