Make sure we don't write negative icon ids into the database.

This commit is contained in:
Felix Geyer 2016-01-31 17:06:51 +01:00
parent c14d04b3e8
commit 107c0673c7

View File

@ -523,6 +523,7 @@ Group* KeePass2XmlReader::parseGroup()
if (m_strictMode) {
raiseError("Invalid group icon number");
}
iconId = 0;
}
else {
if (iconId >= DatabaseIcons::IconCount) {
@ -702,6 +703,7 @@ Entry* KeePass2XmlReader::parseEntry(bool history)
if (m_strictMode) {
raiseError("Invalid entry icon number");
}
iconId = 0;
}
else {
entry->setIcon(iconId);