mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 14:36:07 -05:00
Fix heap-use-after-free & error-msg output in keepassxc-cli
* Fixes #5367
This commit is contained in:
parent
1c27dccabb
commit
9cf93111d6
@ -158,7 +158,7 @@ void enterInteractiveMode(const QStringList& arguments)
|
||||
|
||||
auto cmd = Commands::getCommand(args[0]);
|
||||
if (!cmd) {
|
||||
err << QObject::tr("Unknown command %1").arg(args[0]) << "\n";
|
||||
err << QObject::tr("Unknown command %1").arg(args[0]) << endl;
|
||||
continue;
|
||||
} else if (cmd->name == "quit" || cmd->name == "exit") {
|
||||
break;
|
||||
@ -167,6 +167,7 @@ void enterInteractiveMode(const QStringList& arguments)
|
||||
cmd->currentDatabase = currentDatabase;
|
||||
cmd->execute(args);
|
||||
currentDatabase = cmd->currentDatabase;
|
||||
cmd->currentDatabase.reset();
|
||||
}
|
||||
|
||||
if (currentDatabase) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user