mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey-ekmfweb: Fix selection of key properties to set or remove
When some of the key properties are skipped due to null_values_only being true or false, then the resulting EKMF tag list might be built incorrectly. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
6380e77f28
commit
8781dd3e7b
@@ -4566,22 +4566,23 @@ static int _properties_to_ekmf_tags(struct plugin_handle *UNUSED(ph),
|
||||
struct ekmf_tag_list *ekmf_tag_list,
|
||||
bool null_values_only)
|
||||
{
|
||||
size_t i;
|
||||
size_t i, k;
|
||||
|
||||
ekmf_tag_list->num_tags = 0;
|
||||
ekmf_tag_list->tags = util_malloc(
|
||||
sizeof(struct ekmf_tag) * num_properties);
|
||||
|
||||
for (i = 0; i < num_properties; i++) {
|
||||
for (i = 0, k = 0; i < num_properties; i++) {
|
||||
if (!null_values_only && properties[i].value == NULL)
|
||||
continue;
|
||||
if (null_values_only && properties[i].value != NULL)
|
||||
continue;
|
||||
|
||||
ekmf_tag_list->tags[i].name = util_strdup(properties[i].name);
|
||||
ekmf_tag_list->tags[i].value = properties[i].value != NULL ?
|
||||
ekmf_tag_list->tags[k].name = util_strdup(properties[i].name);
|
||||
ekmf_tag_list->tags[k].value = properties[i].value != NULL ?
|
||||
util_strdup(properties[i].value) : NULL;
|
||||
ekmf_tag_list->num_tags++;
|
||||
k++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user