Skip to content

Commit

Permalink
Added buffer boundary check to avoid potential buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Jan 28, 2025
1 parent e946f49 commit 678697b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/ndpi_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 678697b

Please sign in to comment.