mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Really fix parsing when the db contains two Root (Group) elements.
This commit is contained in:
parent
0ec29b2354
commit
6df30df992
@ -159,13 +159,12 @@ bool KeePass2XmlReader::parseKeePassFile()
|
||||
parseMeta();
|
||||
}
|
||||
else if (m_xml.name() == "Root") {
|
||||
rootParsedSuccesfully = parseRoot();
|
||||
|
||||
if (rootElementFound) {
|
||||
rootParsedSuccesfully = false;
|
||||
raiseError(29);
|
||||
}
|
||||
else {
|
||||
rootParsedSuccesfully = parseRoot();
|
||||
rootElementFound = true;
|
||||
}
|
||||
}
|
||||
@ -437,6 +436,12 @@ bool KeePass2XmlReader::parseRoot()
|
||||
|
||||
while (!m_xml.error() && m_xml.readNextStartElement()) {
|
||||
if (m_xml.name() == "Group") {
|
||||
if (groupElementFound) {
|
||||
groupParsedSuccesfully = false;
|
||||
raiseError(30);
|
||||
continue;
|
||||
}
|
||||
|
||||
Group* rootGroup = parseGroup();
|
||||
if (rootGroup) {
|
||||
Group* oldRoot = m_db->rootGroup();
|
||||
@ -445,13 +450,7 @@ bool KeePass2XmlReader::parseRoot()
|
||||
groupParsedSuccesfully = true;
|
||||
}
|
||||
|
||||
if (groupElementFound) {
|
||||
groupParsedSuccesfully = false;
|
||||
raiseError(30);
|
||||
}
|
||||
else {
|
||||
groupElementFound = true;
|
||||
}
|
||||
groupElementFound = true;
|
||||
}
|
||||
else if (m_xml.name() == "DeletedObjects") {
|
||||
parseDeletedObjects();
|
||||
|
Loading…
Reference in New Issue
Block a user