Skip to content

Commit

Permalink
Allow up to 1420 bytes in fake packet (--fake-from-hex).
Browse files Browse the repository at this point in the history
Since it's a hex string, we should double the length
  • Loading branch information
ValdikSS committed Sep 17, 2024
1 parent 8a0bef0 commit a95fe3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fakepackets.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a95fe3e

Please sign in to comment.