From 742aed4f2e8d46cd9a92c4eafb89986049bedfe4 Mon Sep 17 00:00:00 2001 From: Joey Jiao Date: Thu, 25 Jul 2019 09:12:48 +0800 Subject: Add support for Android --- afl-fuzz.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'afl-fuzz.c') diff --git a/afl-fuzz.c b/afl-fuzz.c index e9fb8bf0..0e252bea 100644 --- a/afl-fuzz.c +++ b/afl-fuzz.c @@ -28,6 +28,9 @@ #endif #define _FILE_OFFSET_BITS 64 +#ifdef __ANDROID__ + #include "android-ashmem.h" +#endif #include "config.h" #include "types.h" #include "debug.h" @@ -11318,6 +11321,7 @@ static void check_term_size(void) { if (ioctl(1, TIOCGWINSZ, &ws)) return; + if (ws.ws_row == 0 || ws.ws_col == 0) return; if (ws.ws_row < 24 || ws.ws_col < 79) term_too_small = 1; } @@ -12370,8 +12374,8 @@ int main(int argc, char** argv) { if (unicorn_mode) FATAL("-U and -n are mutually exclusive"); } - - if (index(argv[optind], '/') == NULL) WARNF(cLRD "Target binary called without a prefixed path, make sure you are fuzzing the right binary: " cRST "%s", argv[optind]); + + if (strchr(argv[optind], '/') == NULL) WARNF(cLRD "Target binary called without a prefixed path, make sure you are fuzzing the right binary: " cRST "%s", argv[optind]); OKF("afl++ is maintained by Marc \"van Hauser\" Heuse, Heiko \"hexcoder\" Eissfeldt and Andrea Fioraldi"); OKF("afl++ is open source, get it at https://github.com/vanhauser-thc/AFLplusplus"); -- cgit 1.4.1