mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
property: correctly set the has optional flag when merging property lists
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12123)
This commit is contained in:
parent
f9e504e8b1
commit
e3d6dc59fb
@ -568,6 +568,7 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
|
||||
if (r == NULL)
|
||||
return NULL;
|
||||
|
||||
r->has_optional = 0;
|
||||
for (i = j = n = 0; i < a->n || j < b->n; n++) {
|
||||
if (i >= a->n) {
|
||||
copy = &bp[j++];
|
||||
@ -581,6 +582,7 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
|
||||
copy = &bp[j++];
|
||||
}
|
||||
memcpy(r->properties + n, copy, sizeof(r->properties[0]));
|
||||
r->has_optional |= copy->optional;
|
||||
}
|
||||
r->n = n;
|
||||
if (n != t)
|
||||
|
Loading…
Reference in New Issue
Block a user