aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-06-21 15:51:27 +0100
committerMatt Caswell <matt@openssl.org>2017-08-21 08:44:44 +0100
commit297c1149f6b8b0f9ade5f2bf12e148056ef77734 (patch)
tree95b2fb904a8e44a9461ad1f67649f5d08dda4750
parent045fe7313a672630881df277321052442bfaca73 (diff)
downloadopenssl-297c1149f6b8b0f9ade5f2bf12e148056ef77734.tar.gz
Remove OPENSSL_assert() from crypto/asn1/bio_asn1.c
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3740)
-rw-r--r--crypto/asn1/bio_asn1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c
index 31fd7258a9..e28ab27767 100644
--- a/crypto/asn1/bio_asn1.c
+++ b/crypto/asn1/bio_asn1.c
@@ -16,6 +16,7 @@
#include <string.h>
#include <internal/bio.h>
#include <openssl/asn1.h>
+#include "internal/cryptlib.h"
/* Must be large enough for biggest tag+length */
#define DEFAULT_ASN1_BUF_SIZE 20
@@ -181,7 +182,8 @@ static int asn1_bio_write(BIO *b, const char *in, int inl)
case ASN1_STATE_HEADER:
ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl;
- OPENSSL_assert(ctx->buflen <= ctx->bufsize);
+ if (!ossl_assert(ctx->buflen <= ctx->bufsize))
+ return 0;
p = ctx->buf;
ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class);
ctx->copylen = inl;