HomeClusterLabs Projects

Low: tools: fix use-after-free of attribute set name

Description

Low: tools: fix use-after-free of attribute set name

cli_resource_update_attribute() previously reused attr_set for each resource
recursively updated. However if attr_set were originally NULL, a local_attr_set
would be newly allocated and attr_set to it. local_attr_set would be freed at
the end of the iteration, but attr_set would be reused for the next iteration.

Now, don't reuse attr_set, but use a new variable rsc_attr_set to use for one
iteration. This way, if the original attr_set is NULL, a new local_attr_set
will be allocated for each iteration.

Details

Provenance
kgaillotAuthored on Apr 10 2023, 2:11 PM
Parents
rP8ff77205698d: Refactor: tools: don't overwrite original attr_id when updating attributes
Branches
Unknown
Tags
Unknown