diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/tasn_dec.c')
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index 8732ab53cf..69e27a9f0f 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_dec.c,v 1.64 2022/05/12 19:11:14 jsing Exp $ */ | 1 | /* $OpenBSD: tasn_dec.c,v 1.65 2022/05/12 19:33:19 jsing 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 | */ |
@@ -249,6 +249,7 @@ asn1_item_ex_d2i_sequence(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
249 | ASN1_aux_cb *asn1_cb = NULL; | 249 | ASN1_aux_cb *asn1_cb = NULL; |
250 | char seq_eoc, seq_nolen, cst, isopt; | 250 | char seq_eoc, seq_nolen, cst, isopt; |
251 | const unsigned char *p = NULL, *q; | 251 | const unsigned char *p = NULL, *q; |
252 | CBS cbs; | ||
252 | int i; | 253 | int i; |
253 | int ret = 0; | 254 | int ret = 0; |
254 | 255 | ||
@@ -383,9 +384,10 @@ asn1_item_ex_d2i_sequence(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
383 | } | 384 | } |
384 | } | 385 | } |
385 | /* Save encoding */ | 386 | /* Save encoding */ |
386 | if (!asn1_enc_save(pval, *in, p - *in, it)) { | 387 | CBS_init(&cbs, *in, p - *in); |
388 | if (!asn1_enc_save(pval, &cbs, it)) { | ||
387 | ASN1error(ERR_R_MALLOC_FAILURE); | 389 | ASN1error(ERR_R_MALLOC_FAILURE); |
388 | goto auxerr; | 390 | goto err; |
389 | } | 391 | } |
390 | *in = p; | 392 | *in = p; |
391 | if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) | 393 | if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) |