mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Raise an error when parsing duplicate attributes/attachments.
This commit is contained in:
parent
3ea0592b53
commit
eb22f0a2d8
@ -825,8 +825,14 @@ void KeePass2XmlReader::parseEntryString(Entry* entry)
|
||||
}
|
||||
|
||||
if (keySet && valueSet) {
|
||||
// the default attributes are always there so additionally check if it's empty
|
||||
if (entry->attributes()->hasKey(key) && !entry->attributes()->value(key).isEmpty()) {
|
||||
raiseError("Duplicate custom attribute found");
|
||||
}
|
||||
else {
|
||||
entry->attributes()->set(key, value, protect);
|
||||
}
|
||||
}
|
||||
else {
|
||||
raiseError("Entry string key or value missing");
|
||||
}
|
||||
@ -874,8 +880,13 @@ QPair<QString, QString> KeePass2XmlReader::parseEntryBinary(Entry* entry)
|
||||
}
|
||||
|
||||
if (keySet && valueSet) {
|
||||
if (entry->attachments()->hasKey(key)) {
|
||||
raiseError("Duplicate attachment found");
|
||||
}
|
||||
else {
|
||||
entry->attachments()->set(key, value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
raiseError("Entry binary key or value missing");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user