summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2015-07-20 15:41:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2015-07-20 15:41:49 +0000
commit2aeb0f0a8ca3469ac64cec74b7c8d546f0021f56 (patch)
tree64acd56a3ba4f1cf70844868d591c94cd4dbfa0e /lib/libcrypto/asn1
parent961b0bad685239470d77eb955d2d7971be5910e2 (diff)
Check the return value of asn1_enc_save(). ok bcook@ doug@
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r--lib/libcrypto/asn1/tasn_dec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrypto/asn1/tasn_dec.c b/lib/libcrypto/asn1/tasn_dec.c
index 7d61a6a2338..f08514dc832 100644
--- a/lib/libcrypto/asn1/tasn_dec.c
+++ b/lib/libcrypto/asn1/tasn_dec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tasn_dec.c,v 1.26 2015/03/19 14:00:22 tedu Exp $ */
+/* $OpenBSD: tasn_dec.c,v 1.27 2015/07/20 15:41:48 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -431,8 +431,10 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
}
}
/* Save encoding */
- if (!asn1_enc_save(pval, *in, p - *in, it))
+ if (!asn1_enc_save(pval, *in, p - *in, it)) {
+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_MALLOC_FAILURE);
goto auxerr;
+ }
*in = p;
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
goto auxerr;