summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/tasn_fre.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c
index 83c073b55d..0e259a13ab 100644
--- a/src/lib/libcrypto/asn1/tasn_fre.c
+++ b/src/lib/libcrypto/asn1/tasn_fre.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_fre.c,v 1.23 2023/07/28 10:00:10 tb Exp $ */ 1/* $OpenBSD: tasn_fre.c,v 1.24 2024/12/11 11:22:06 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -152,10 +152,9 @@ asn1_item_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
152 * determine the type of the field it defines. So 152 * determine the type of the field it defines. So
153 * free up in reverse order. 153 * free up in reverse order.
154 */ 154 */
155 tt = it->templates + it->tcount - 1; 155 for (i = it->tcount - 1; i >= 0; i--) {
156 for (i = 0; i < it->tcount; tt--, i++) {
157 ASN1_VALUE **pseqval; 156 ASN1_VALUE **pseqval;
158 seqtt = asn1_do_adb(pval, tt, 0); 157 seqtt = asn1_do_adb(pval, &it->templates[i], 0);
159 if (!seqtt) 158 if (!seqtt)
160 continue; 159 continue;
161 pseqval = asn1_get_field_ptr(pval, seqtt); 160 pseqval = asn1_get_field_ptr(pval, seqtt);