As there is no default case for a->type or b->type in the switch()
statements, if the type does not fall into any defined cases
then memcmp() will be done on garbage data.
Adding default cases in both switches.
CLA: trivial
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23082)
return -1;
prefixlen_a = length * 8;
break;
+ default:
+ return -1;
}
switch (b->type) {
return -1;
prefixlen_b = length * 8;
break;
+ default:
+ return -1;
}
if ((r = memcmp(addr_a, addr_b, length)) != 0)