Fix: Sudden exit on bookmarking a new (not saved) file (Bug #2599802)

Safer SecString::overwrite(QString&)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@261 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
sniperbeamer
2009-02-15 13:59:44 +00:00
parent 77500ca0e9
commit 5e473bedc2
3 changed files with 16 additions and 19 deletions

View File

@@ -85,10 +85,9 @@ void SecString::overwrite(unsigned char* str, int strlen){
}
void SecString::overwrite(QString& str){
if(str.length()==0)
return;
overwrite((unsigned char*)str.data(), str.capacity());
for (int i=0; i<str.length(); i++) {
str[i] = '\0';
}
}
void SecString::generateSessionKey(){