Return 1 when openssl req -addext kv is duplicated
CLA: trivial Fixes #10273 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10578)
This commit is contained in:
parent
1461138271
commit
1aeec3dbc2
1 changed files with 6 additions and 3 deletions
|
@ -214,9 +214,12 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
/* Finally have a clean "key"; see if it's there [by attempt to add it]. */
|
/* Finally have a clean "key"; see if it's there [by attempt to add it]. */
|
||||||
if ((p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv))
|
p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv);
|
||||||
!= NULL || lh_OPENSSL_STRING_error(addexts)) {
|
if (p != NULL) {
|
||||||
OPENSSL_free(p != NULL ? p : kv);
|
OPENSSL_free(p);
|
||||||
|
return 1;
|
||||||
|
} else if (lh_OPENSSL_STRING_error(addexts)) {
|
||||||
|
OPENSSL_free(kv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue