aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-20 09:22:14 +0200
committervan Hauser <vh@thc.org>2020-06-20 09:22:14 +0200
commit1381e96d8ce09c6c09704764da189609fbe841cf (patch)
tree5504ae089b3c5dc35edb2bcb7aa1517eb9963067
parent5ca303393f0c3646c1ad032787f85c340c3aebbc (diff)
downloadafl++-1381e96d8ce09c6c09704764da189609fbe841cf.tar.gz
fix ascii percentage calc
-rw-r--r--src/afl-fuzz-queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 8f2d5a24..9988f335 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -108,7 +108,7 @@ static u8 check_if_text(struct queue_entry *q) {
if (q->len < AFL_TXT_MIN_LEN) return 0;
u8 buf[MAX_FILE];
- s32 fd, len = q->len, offset = 0, ascii = 0, utf8 = 0, type, comp;
+ s32 fd, len = q->len, offset = 0, ascii = 0, utf8 = 0, comp;
if ((fd = open(q->fname, O_RDONLY)) < 0) return 0;
if ((comp = read(fd, buf, len)) != len) return 0;
@@ -198,7 +198,7 @@ static u8 check_if_text(struct queue_entry *q) {
if (percent_utf8 >= percent_ascii && percent_utf8 >= AFL_TXT_MIN_PERCENT)
return 2;
- if (percent_utf8 >= AFL_TXT_MIN_PERCENT)
+ if (percent_ascii >= AFL_TXT_MIN_PERCENT)
return 1;
return 0;