Optimizes and fixes possible out0of0boundary write in ndpi_fill_prefix_v4()
This commit is contained in:
+1
-4
@@ -2229,10 +2229,7 @@ int ndpi_fill_prefix_v4(ndpi_prefix_t *p, const struct in_addr *a, int b, int mb
|
|||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
memset(p, 0, sizeof(ndpi_prefix_t));
|
memset(p, 0, sizeof(ndpi_prefix_t));
|
||||||
memcpy(&p->add.sin, a, (mb + 7) / 8);
|
p->add.sin.s_addr = a->s_addr, p->family = AF_INET, p->bitlen = b, p->ref_count = 0;
|
||||||
p->family = AF_INET;
|
|
||||||
p->bitlen = b;
|
|
||||||
p->ref_count = 0;
|
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user