mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-18 11:49:39 -04:00
kdbx-extract: Don't abort if parsing the XML data fails.
This commit is contained in:
parent
ac56ac98f7
commit
e92981b476
1 changed files with 10 additions and 3 deletions
|
@ -65,13 +65,20 @@ int main(int argc, char **argv)
|
||||||
reader.setSaveXml(true);
|
reader.setSaveXml(true);
|
||||||
reader.readDatabase(&dbFile, key);
|
reader.readDatabase(&dbFile, key);
|
||||||
|
|
||||||
|
QByteArray xmlData = reader.xmlData();
|
||||||
|
|
||||||
if (reader.hasError()) {
|
if (reader.hasError()) {
|
||||||
|
if (xmlData.isEmpty()) {
|
||||||
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
qWarning("Error while parsing the database:\n%s\n", qPrintable(reader.errorString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QTextStream out(stdout);
|
QTextStream out(stdout);
|
||||||
out << reader.xmlData().constData() << "\n";
|
out << xmlData.constData() << "\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue