Skip to content

Commit

Permalink
Optimizes and fixes possible out0of0boundary write in ndpi_fill_prefi…
Browse files Browse the repository at this point in the history
…x_v4()
  • Loading branch information
lucaderi committed Jun 23, 2023
1 parent 7e64d9f commit 7ef80f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2229,10 +2229,7 @@ int ndpi_fill_prefix_v4(ndpi_prefix_t *p, const struct in_addr *a, int b, int mb
return(-1);

memset(p, 0, sizeof(ndpi_prefix_t));
memcpy(&p->add.sin, a, (mb + 7) / 8);
p->family = AF_INET;
p->bitlen = b;
p->ref_count = 0;
p->add.sin.s_addr = a->s_addr, p->family = AF_INET, p->bitlen = b, p->ref_count = 0;

return(0);
}
Expand Down

0 comments on commit 7ef80f6

Please sign in to comment.