From: Kurt Roeckx Date: Sat, 6 Aug 2016 17:16:00 +0000 (+0200) Subject: Fix off by 1 in ASN1_STRING_set() X-Git-Tag: OpenSSL_1_0_2i~68 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=061d6c25ba7cb0524756a872e92da1de2d494d68;p=oweals%2Fopenssl.git Fix off by 1 in ASN1_STRING_set() Reviewed-by: Rich Salz MR: #3176 (cherry picked from commit a73be798ced572a988d455d961a2387f6eccb549) --- diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index 80f5f2b014..e63e82a8b4 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -370,7 +370,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; if (c == NULL) str->data = OPENSSL_malloc(len + 1);