mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-21 12:38:12 -04:00
Really fix parsing when the db contains two Root (Group) elements.
This commit is contained in:
parent
0ec29b2354
commit
6df30df992
1 changed files with 8 additions and 9 deletions
|
@ -159,13 +159,12 @@ bool KeePass2XmlReader::parseKeePassFile()
|
||||||
parseMeta();
|
parseMeta();
|
||||||
}
|
}
|
||||||
else if (m_xml.name() == "Root") {
|
else if (m_xml.name() == "Root") {
|
||||||
rootParsedSuccesfully = parseRoot();
|
|
||||||
|
|
||||||
if (rootElementFound) {
|
if (rootElementFound) {
|
||||||
rootParsedSuccesfully = false;
|
rootParsedSuccesfully = false;
|
||||||
raiseError(29);
|
raiseError(29);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
rootParsedSuccesfully = parseRoot();
|
||||||
rootElementFound = true;
|
rootElementFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,6 +436,12 @@ bool KeePass2XmlReader::parseRoot()
|
||||||
|
|
||||||
while (!m_xml.error() && m_xml.readNextStartElement()) {
|
while (!m_xml.error() && m_xml.readNextStartElement()) {
|
||||||
if (m_xml.name() == "Group") {
|
if (m_xml.name() == "Group") {
|
||||||
|
if (groupElementFound) {
|
||||||
|
groupParsedSuccesfully = false;
|
||||||
|
raiseError(30);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Group* rootGroup = parseGroup();
|
Group* rootGroup = parseGroup();
|
||||||
if (rootGroup) {
|
if (rootGroup) {
|
||||||
Group* oldRoot = m_db->rootGroup();
|
Group* oldRoot = m_db->rootGroup();
|
||||||
|
@ -445,14 +450,8 @@ bool KeePass2XmlReader::parseRoot()
|
||||||
groupParsedSuccesfully = true;
|
groupParsedSuccesfully = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupElementFound) {
|
|
||||||
groupParsedSuccesfully = false;
|
|
||||||
raiseError(30);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
groupElementFound = true;
|
groupElementFound = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (m_xml.name() == "DeletedObjects") {
|
else if (m_xml.name() == "DeletedObjects") {
|
||||||
parseDeletedObjects();
|
parseDeletedObjects();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue