summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2016-08-06 19:16:00 +0200
committerKurt Roeckx <kurt@roeckx.be>2016-08-20 18:53:56 +0200
commita73be798ced572a988d455d961a2387f6eccb549 (patch)
tree3f81e8b35ec8f795484234dd181646ea93ee0eae
parent8b8d963db5bb619fbada014f294fd09a855a2650 (diff)
Fix off by 1 in ASN1_STRING_set()
Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #3176
-rw-r--r--crypto/asn1/asn1_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c
index f2f07ac2d5..9dfe395399 100644
--- a/crypto/asn1/asn1_lib.c
+++ b/crypto/asn1/asn1_lib.c
@@ -271,7 +271,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
else
len = strlen(data);
}
- if ((str->length < len) || (str->data == NULL)) {
+ if ((str->length <= len) || (str->data == NULL)) {
c = str->data;
str->data = OPENSSL_realloc(c, len + 1);
if (str->data == NULL) {