From a95fe3ebff743f2af5ce5b9dce6cd58f4b7c8759 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Tue, 17 Sep 2024 17:13:41 +0300 Subject: [PATCH] Allow up to 1420 bytes in fake packet (`--fake-from-hex`). Since it's a hex string, we should double the length --- src/fakepackets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fakepackets.c b/src/fakepackets.c index c504345..1cf262e 100644 --- a/src/fakepackets.c +++ b/src/fakepackets.c @@ -251,7 +251,7 @@ static int fake_add(const unsigned char *data, size_t size) { int fake_load_from_hex(const char *data) { size_t len = strlen(data); - if (len < 2 || len % 2 || len > 1420) + if (len < 2 || len % 2 || len > (1420 * 2)) return 1; unsigned char *finaldata = calloc((len + 2) / 2, 1);