summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui
diff options
context:
space:
mode:
authortb <>2026-05-18 04:24:01 +0000
committertb <>2026-05-18 04:24:01 +0000
commit8bb94b7a3d27460eb52d28debd9344cbb83a1108 (patch)
tree5677e09bbaf5eed377dc7674763218788c21dd75 /src/lib/libcrypto/ui
parent4aaf2a3333ff91e8329e1dddd19d905b9c523c02 (diff)
downloadopenbsd-8bb94b7a3d27460eb52d28debd9344cbb83a1108.tar.gz
openbsd-8bb94b7a3d27460eb52d28debd9344cbb83a1108.tar.bz2
openbsd-8bb94b7a3d27460eb52d28debd9344cbb83a1108.zip
x509_addr: do not call memcmp() on NULL
If the minimum length is 0, either a->data or b->data could be NULL, so do not call memcmp() and let the length comparison decide. Doing it this way preserves the RFC 3779, section 2.2.3.3 semantics and avoids the UB. A valid IPAddressFamily has an addressFamily element of 2 or 3 octets: 2 octets for the AFI and 1 octet for the optional SAFI. The check as it is written compares the AFIs and, if they're equal, lets absent SAFI be smaller than any other SAFI. So IPv4 (0x0001) sorts before IPv4 unicast (0x000101) and that in turn sorts before IPv6 (0x0002). Found by beck while breaking OpenSSL ok kenjiro
Diffstat (limited to 'src/lib/libcrypto/ui')
0 files changed, 0 insertions, 0 deletions