Skip to content

Commit

Permalink
Fix off by 1 in ASN1_STRING_set()
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <rsalz@openssl.org>

MR: #3176
(cherry picked from commit a73be79)
  • Loading branch information
kroeckx committed Aug 20, 2016
1 parent 19fca4c commit f3e01c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/asn1/asn1_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f3e01c8

Please sign in to comment.