Fix off by 1 in ASN1_STRING_set()

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

MR: #3176
This commit is contained in:
Kurt Roeckx 2016-08-06 19:16:00 +02:00
parent 8b8d963db5
commit a73be798ce

View file

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