diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_addr.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c index fdb2f64fd2..f6dbb3a9c1 100644 --- a/src/lib/libcrypto/x509/x509_addr.c +++ b/src/lib/libcrypto/x509/x509_addr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_addr.c,v 1.52 2022/01/04 20:17:07 tb Exp $ */ | 1 | /* $OpenBSD: x509_addr.c,v 1.53 2022/01/04 20:21:04 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Contributed to the OpenSSL Project by the American Registry for | 3 | * Contributed to the OpenSSL Project by the American Registry for |
| 4 | * Internet Numbers ("ARIN"). | 4 | * Internet Numbers ("ARIN"). |
| @@ -1088,12 +1088,22 @@ int | |||
| 1088 | X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, | 1088 | X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, |
| 1089 | unsigned char *min, unsigned char *max, const int length) | 1089 | unsigned char *min, unsigned char *max, const int length) |
| 1090 | { | 1090 | { |
| 1091 | int afi_length = length_from_afi(afi); | 1091 | int afi_length; |
| 1092 | if (aor == NULL || min == NULL || max == NULL || | 1092 | |
| 1093 | afi_length == 0 || length < afi_length || | 1093 | if (aor == NULL || min == NULL || max == NULL) |
| 1094 | (aor->type != IPAddressOrRange_addressPrefix && | 1094 | return 0; |
| 1095 | aor->type != IPAddressOrRange_addressRange) || | 1095 | |
| 1096 | !extract_min_max(aor, min, max, afi_length)) | 1096 | if ((afi_length = length_from_afi(afi)) == 0) |
| 1097 | return 0; | ||
| 1098 | |||
| 1099 | if (length < afi_length) | ||
| 1100 | return 0; | ||
| 1101 | |||
| 1102 | if (aor->type != IPAddressOrRange_addressPrefix && | ||
| 1103 | aor->type != IPAddressOrRange_addressRange) | ||
| 1104 | return 0; | ||
| 1105 | |||
| 1106 | if (!extract_min_max(aor, min, max, afi_length)) | ||
| 1097 | return 0; | 1107 | return 0; |
| 1098 | 1108 | ||
| 1099 | return afi_length; | 1109 | return afi_length; |
