diff options
author | Luca Deri <deri@ntop.org> | 2025-01-28 18:33:14 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2025-01-28 18:33:14 +0100 |
commit | 678697b5eb6c3caa5dd5f8cccfe9eed8d13b94bb (patch) | |
tree | fac153ec7410184a5e6fedeee58ffc999d695e12 /src | |
parent | e946f49aca13e4447a7d7b2acae6323a4531fb55 (diff) |
Added buffer boundary check to avoid potential buffer overflow
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_cache.c b/src/lib/ndpi_cache.c index a85cb1623..00e2a2011 100644 --- a/src/lib/ndpi_cache.c +++ b/src/lib/ndpi_cache.c @@ -439,7 +439,7 @@ u_int32_t ndpi_address_cache_restore(struct ndpi_address_cache *cache, char *pat if(!fd) return(false); - while(fscanf(fd, "%s\t%s\t%u\n", ip, hostname, &epoch) > 0) { + while(fscanf(fd, "%32s\t%255s\t%u\n", ip, hostname, &epoch) > 0) { if(epoch >= epoch_now) { /* Entry not yet expired */ u_int ttl = epoch-epoch_now; ndpi_ip_addr_t addr; |