mooltipass / moolticute

Mooltipass crossplatform daemon/tools
GNU General Public License v3.0
143 stars 67 forks source link

MPDevice: Fix free-after-use segfaults #1154

Closed barathrm closed 1 year ago

barathrm commented 1 year ago

This fixes possible free-after-use cases caused by the node lists in MPDevice containing raw pointers and the parent nodes having their child nodes set as QObject children. The QObject children of a parent node are automatically freed when a parent node is destructed, but if their corresponding raw pointers aren't removed from the node lists they may cause free-after-use bugs.

This patch removes the child nodes from the local DB before removing the parent to prevent this from happening.

Closes #1135