diff options
author | Adam Ć ulc <sulcadam12@gmail.com> | 2023-07-20 21:30:45 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-07-24 12:44:46 +1000 |
commit | 7551264186f176ca5801aa84d60c7b91d8fba31f (patch) | |
tree | f8a18162ec5799b3e1dff6c7ed004c482216f39c /crypto | |
parent | 6cac1ce47128f5095b1f0b99f304589db034c305 (diff) |
fix: reject adding a duplicity into STACK_OF(X509_ATTRIBUTE)
Function `X509at_add1_attr()` (crypto/x509/x509_att.c) rejects to add a duplicity into `*x` but it searches in a wrong stack.
Changed to search in `*x`.
CLA: trivial
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21505)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509/x509_att.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c index 1fc99f7cad..325a0dc1dd 100644 --- a/crypto/x509/x509_att.c +++ b/crypto/x509/x509_att.c @@ -89,7 +89,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER); return NULL; } - if (X509at_get_attr_by_OBJ(sk, attr->object, -1) != -1) { + if (*x != NULL && X509at_get_attr_by_OBJ(*x, attr->object, -1) != -1) { ERR_raise(ERR_LIB_X509, X509_R_DUPLICATE_ATTRIBUTE); return NULL; } |