From: tb Date: Tue, 4 Jan 2022 20:23:05 +0000 (+0000) Subject: Remove checks that are duplicated in extract_min_max() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f762180dafab668a02b8db22e646488a35eb2d2e;p=openbsd Remove checks that are duplicated in extract_min_max() The NULL checks and the checks that aor->type is reasonable are already performed in extract_min_max(), so it is unnecessary to repeat them in X509v3_addr_get_range() ok inoguchi jsing --- diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index f6dbb3a9c19..d3cdebba254 100644 --- a/lib/libcrypto/x509/x509_addr.c +++ b/lib/libcrypto/x509/x509_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_addr.c,v 1.53 2022/01/04 20:21:04 tb Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.54 2022/01/04 20:23:05 tb Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -1090,19 +1090,12 @@ X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, { int afi_length; - if (aor == NULL || min == NULL || max == NULL) - return 0; - if ((afi_length = length_from_afi(afi)) == 0) return 0; if (length < afi_length) return 0; - if (aor->type != IPAddressOrRange_addressPrefix && - aor->type != IPAddressOrRange_addressRange) - return 0; - if (!extract_min_max(aor, min, max, afi_length)) return 0;