summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2015-07-20 15:41:48 +0000
committermiod <>2015-07-20 15:41:48 +0000
commit6cfa8128efb13a4c9685a98c10b59f1c880a72c0 (patch)
tree50d1adf387f60bfff679fdf81513d9bc6bee5b56 /src
parentad64bd77855220f45e0e3adbd4f6ffa738a5a7d2 (diff)
downloadopenbsd-6cfa8128efb13a4c9685a98c10b59f1c880a72c0.tar.gz
openbsd-6cfa8128efb13a4c9685a98c10b59f1c880a72c0.tar.bz2
openbsd-6cfa8128efb13a4c9685a98c10b59f1c880a72c0.zip
Check the return value of asn1_enc_save(). ok bcook@ doug@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/tasn_dec.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_dec.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c
index 7d61a6a233..f08514dc83 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.26 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: tasn_dec.c,v 1.27 2015/07/20 15:41:48 miod 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 */
@@ -431,8 +431,10 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
431 } 431 }
432 } 432 }
433 /* Save encoding */ 433 /* Save encoding */
434 if (!asn1_enc_save(pval, *in, p - *in, it)) 434 if (!asn1_enc_save(pval, *in, p - *in, it)) {
435 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_MALLOC_FAILURE);
435 goto auxerr; 436 goto auxerr;
437 }
436 *in = p; 438 *in = p;
437 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) 439 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
438 goto auxerr; 440 goto auxerr;
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_dec.c b/src/lib/libssl/src/crypto/asn1/tasn_dec.c
index 7d61a6a233..f08514dc83 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_dec.c
+++ b/src/lib/libssl/src/crypto/asn1/tasn_dec.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_dec.c,v 1.26 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: tasn_dec.c,v 1.27 2015/07/20 15:41:48 miod 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 */
@@ -431,8 +431,10 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
431 } 431 }
432 } 432 }
433 /* Save encoding */ 433 /* Save encoding */
434 if (!asn1_enc_save(pval, *in, p - *in, it)) 434 if (!asn1_enc_save(pval, *in, p - *in, it)) {
435 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_MALLOC_FAILURE);
435 goto auxerr; 436 goto auxerr;
437 }
436 *in = p; 438 *in = p;
437 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) 439 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
438 goto auxerr; 440 goto auxerr;