mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-07 22:12:59 -04:00
Check XML key file for valid base64 before using it.
QByteArray::fromBase64() doesn't validate the input. Closes #366
This commit is contained in:
parent
820941fd40
commit
2fa531745f
6 changed files with 25 additions and 1 deletions
|
@ -211,7 +211,10 @@ QByteArray FileKey::loadXmlKey(QXmlStreamReader& xmlReader)
|
|||
while (!xmlReader.error() && xmlReader.readNextStartElement()) {
|
||||
if (xmlReader.name() == "Data") {
|
||||
// TODO: do we need to enforce a specific data.size()?
|
||||
data = QByteArray::fromBase64(xmlReader.readElementText().toLatin1());
|
||||
QByteArray rawData = xmlReader.readElementText().toLatin1();
|
||||
if (Tools::isBase64(rawData)) {
|
||||
data = QByteArray::fromBase64(rawData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue