summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_enum.c')
-rw-r--r--src/lib/libcrypto/asn1/a_enum.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c
index 11868cef37..3b6cd9f954 100644
--- a/src/lib/libcrypto/asn1/a_enum.c
+++ b/src/lib/libcrypto/asn1/a_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_enum.c,v 1.24 2022/06/25 16:15:18 jsing Exp $ */ 1/* $OpenBSD: a_enum.c,v 1.25 2022/07/09 14:46:43 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -141,6 +141,8 @@ ASN1_ENUMERATED_get(const ASN1_ENUMERATED *aenum)
141{ 141{
142 int64_t val; 142 int64_t val;
143 143
144 if (aenum == NULL)
145 return 0;
144 if (!ASN1_ENUMERATED_get_int64(&val, aenum)) 146 if (!ASN1_ENUMERATED_get_int64(&val, aenum))
145 return -1; 147 return -1;
146 if (val < LONG_MIN || val > LONG_MAX) { 148 if (val < LONG_MIN || val > LONG_MAX) {