Home GnuPG

Avoid nasty use-after-delete crashes when starting commands

Description

Avoid nasty use-after-delete crashes when starting commands

This change defers the actual start of the command and returns immediately
to avoid problems if the caller, e.g. an action of a menu, is deleted
before start returns.

This problem occurred with the KeyToCardCommand which is started by a
lambda of an action in a context menu. This context menu is deleted when
it's hidden. KeyToCardCommand's start opens a message box which triggers
the hiding (and deletion) of the menu. When the message box is closed,
KeyToCardCommand's start returns to the deleted context menu (which may
or may not cause a crash or an abort; e.g. libc aborted the application
with "malloc(): unaligned tcache chunk detected").

Details

Provenance
ikloeckerAuthored on Nov 17 2022, 10:04 AM
Parents
rKLEOPATRAd8a4215a5109: GIT_SILENT Sync po/docbooks with svn
Branches
Unknown
Tags
Unknown
Tasks
T6281: Kleopatra: Crash when copying a key to a smart card