about summary refs log tree commit diff
path: root/afl-fuzz.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-08-23 12:42:11 +0200
committerGitHub <noreply@github.com>2019-08-23 12:42:11 +0200
commitb79adc01fa782c962aa1915e0484f63f0ebb7043 (patch)
tree48a79f2b96f3758a50d5b3e78b8014bf27cc802b /afl-fuzz.c
parent790d717543ae415ee30224644dd45fa408bba0c5 (diff)
parenta51d4227b6c1a6fec2a471aa9497b6d8201411ae (diff)
downloadafl++-b79adc01fa782c962aa1915e0484f63f0ebb7043.tar.gz
Merge pull request #28 from JoeyJiao/mine_android
Port for Android
Diffstat (limited to 'afl-fuzz.c')
-rw-r--r--afl-fuzz.c8
1 files changed, 6 insertions, 2 deletions
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");