about summary refs log tree commit diff
path: root/src/afl-fuzz-cmplog.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-03-31 04:22:22 +0200
committerDominik Maier <domenukk@gmail.com>2020-04-01 13:10:07 +0200
commit5a4d4ad7360875fea9efb330a55afe4771e1a428 (patch)
tree7cc25f56b37ca8a8a67f3ba427fddb590344b694 /src/afl-fuzz-cmplog.c
parent5bc6dccbbd6167b556af751755f0ae02c1ca2a8f (diff)
downloadafl++-5a4d4ad7360875fea9efb330a55afe4771e1a428.tar.gz
fixed bug in cmplog
Diffstat (limited to 'src/afl-fuzz-cmplog.c')
-rw-r--r--src/afl-fuzz-cmplog.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/afl-fuzz-cmplog.c b/src/afl-fuzz-cmplog.c
index 08ac15c7..f932f33b 100644
--- a/src/afl-fuzz-cmplog.c
+++ b/src/afl-fuzz-cmplog.c
@@ -187,13 +187,13 @@ void init_cmplog_forkserver(afl_state_t *afl) {
     rlen = 4;
     u32 timeout_ms = afl->fsrv.exec_tmout * FORK_WAIT_MULT;
     /* Reuse readfds as exceptfds to see when the child closed the pipe */
-    u32 time_ms = read_timed(afl->cmplog_fsrv_st_fd, &status, rlen, timeout_ms);
+    u32 exec_ms = read_timed(afl->cmplog_fsrv_st_fd, &status, rlen, timeout_ms);
 
-    if (!time_ms) {
+    if (!exec_ms) {
 
       PFATAL("Error in timed read");
 
-    } else if (time_ms > timeout_ms) {
+    } else if (exec_ms > timeout_ms) {
 
       afl->fsrv.child_timed_out = 1;
       kill(afl->cmplog_fsrv_pid, SIGKILL);
@@ -377,7 +377,7 @@ void init_cmplog_forkserver(afl_state_t *afl) {
 u8 run_cmplog_target(afl_state_t *afl, u32 timeout) {
 
   int status = 0;
-  u64 exec_ms;
+  u32 exec_ms;
 
   u32 tb4;
   s32 res;
@@ -416,9 +416,9 @@ u8 run_cmplog_target(afl_state_t *afl, u32 timeout) {
 
   /* Configure timeout, as requested by user, then wait for child to terminate.
    */
-  u32 time_ms = read_timed(afl->cmplog_fsrv_st_fd, &status, 4, timeout);
+  exec_ms = read_timed(afl->cmplog_fsrv_st_fd, &status, 4, timeout);
 
-  if (time_ms > timeout) {
+  if (exec_ms > timeout) {
 
     /* If there was no response from forkserver after timeout seconds,
     we kill the child. The forkserver should inform us afterwards */
@@ -427,11 +427,11 @@ u8 run_cmplog_target(afl_state_t *afl, u32 timeout) {
     afl->fsrv.child_timed_out = 1;
 
     /* After killing the child, the forkserver should tell us */
-    if (!read(afl->cmplog_fsrv_st_fd, &status, 4)) time_ms = 0;
+    if (!read(afl->cmplog_fsrv_st_fd, &status, 4)) exec_ms = 0;
 
   }
 
-  if (!time_ms) {  // Something went wrong.
+  if (!exec_ms) {  // Something went wrong.
 
     if (afl->stop_soon) return 0;
     SAYF("\n" cLRD "[-] " cRST