Fix off by 1 in ASN1_STRING_set()

Reviewed-by: Rich Salz <rsalz@openssl.org>

MR: #3176
(cherry picked from commit a73be798ce)
This commit is contained in:
Kurt Roeckx 2016-08-06 19:16:00 +02:00
parent ff5537c255
commit 061d6c25ba

View file

@ -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);