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:
parent
ff5537c255
commit
061d6c25ba
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue