afl-as.c, fix compiler warnings (overflowing is UB)

This commit is contained in:
hexcoder-
2020-12-12 19:30:56 +01:00
parent 109560e73a
commit 7382cf5f00

View File

@ -47,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <ctype.h>
#include <fcntl.h>
@ -131,7 +132,7 @@ static void edit_params(int argc, char **argv) {
if (!tmp_dir) { tmp_dir = "/tmp"; }
as_params = ck_alloc((argc + 32) * sizeof(u8 *));
if (unlikely((argc + 32) < argc || !as_params)) {
if (unlikely((INT_MAX - 32) < argc || !as_params)) {
FATAL("Too many parameters passed to as");