mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-27 06:47:02 -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]);
|
auto cmd = Commands::getCommand(args[0]);
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
err << QObject::tr("Unknown command %1").arg(args[0]) << "\n";
|
err << QObject::tr("Unknown command %1").arg(args[0]) << endl;
|
||||||
continue;
|
continue;
|
||||||
} else if (cmd->name == "quit" || cmd->name == "exit") {
|
} else if (cmd->name == "quit" || cmd->name == "exit") {
|
||||||
break;
|
break;
|
||||||
@ -167,6 +167,7 @@ void enterInteractiveMode(const QStringList& arguments)
|
|||||||
cmd->currentDatabase = currentDatabase;
|
cmd->currentDatabase = currentDatabase;
|
||||||
cmd->execute(args);
|
cmd->execute(args);
|
||||||
currentDatabase = cmd->currentDatabase;
|
currentDatabase = cmd->currentDatabase;
|
||||||
|
cmd->currentDatabase.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentDatabase) {
|
if (currentDatabase) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user