Patrica tree: fix handling of mac addresses (#2362)

Found looking at the fuzzer statistics...
This commit is contained in:
Ivan Nardi
2024-04-03 14:10:37 +02:00
committed by GitHub
parent 41eef9246c
commit 1acc9ee396
+10
View File
@@ -238,6 +238,16 @@ static ndpi_prefix_t * ndpi_New_Prefix2 (int family, void *dest, int bitlen, ndp
}
memcpy (&prefix->add.sin, dest, sizeof(struct in_addr));
}
else if(family == AF_MAC) {
default_bitlen = 48;
if(prefix == NULL) {
prefix = (ndpi_prefix_t*)ndpi_calloc(1, sizeof (ndpi_prefix_t));
if(!prefix)
return (NULL);
dynamic_allocated++;
}
memcpy (prefix->add.mac, dest, 6);
}
else {
return (NULL);
}