prompt: zero password memory after running the command to be slightly more secure
This commit is contained in:
parent
c82b5bd016
commit
66a40a37cd
|
@ -1585,7 +1585,11 @@ const CommandDesc prompt_cmd = {
|
||||||
CommandManager::instance().execute(command, context, shell_context);
|
CommandManager::instance().execute(command, context, shell_context);
|
||||||
|
|
||||||
if (password)
|
if (password)
|
||||||
|
{
|
||||||
|
const String& str = RegisterManager::instance()[reg].values(context)[0];
|
||||||
|
memset(const_cast<String&>(str).data(), 0, (int)str.length());
|
||||||
RegisterManager::instance()[reg] = ConstArrayView<String>("");
|
RegisterManager::instance()[reg] = ConstArrayView<String>("");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user