mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
fix ascii percentage calc
This commit is contained in:
@ -108,7 +108,7 @@ static u8 check_if_text(struct queue_entry *q) {
|
|||||||
if (q->len < AFL_TXT_MIN_LEN) return 0;
|
if (q->len < AFL_TXT_MIN_LEN) return 0;
|
||||||
|
|
||||||
u8 buf[MAX_FILE];
|
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 ((fd = open(q->fname, O_RDONLY)) < 0) return 0;
|
||||||
if ((comp = read(fd, buf, len)) != len) 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)
|
if (percent_utf8 >= percent_ascii && percent_utf8 >= AFL_TXT_MIN_PERCENT)
|
||||||
return 2;
|
return 2;
|
||||||
if (percent_utf8 >= AFL_TXT_MIN_PERCENT)
|
if (percent_ascii >= AFL_TXT_MIN_PERCENT)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user