HomeClusterLabs Projects

Low: tools: avoid use-after-free of attribute ID

Description

Low: tools: avoid use-after-free of attribute ID

Previously, cli_resource_delete_attribute() would reuse attr_id for each
recursively updated resource. However, if the original attr_id were NULL,
attr_id would be set to found_attr_id. found_attr_id would be freed at the end
of each iteration, but attr_id would be reused for the next one.

Now, don't change the original attr_id, and instead use a new variable
rsc_attr_id that is only used for one iteration.

Details

Provenance
kgaillotAuthored on Apr 10 2023, 2:16 PM
Parents
rP8d2ee76912a1: Low: tools: fix use-after-free of attribute set name
Branches
Unknown
Tags
Unknown