Optimizes and fixes possible out0of0boundary write in ndpi_fill_prefix_v4()

This commit is contained in:
Luca Deri
2023-06-23 21:40:55 +02:00
parent 7e64d9f66d
commit 7ef80f6b78
+1 -4
View File
@@ -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);
}