mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
KdbxReader::readDatabase: abort if reading magic numbers fails
Building with -flto caught the fact that we were ignoring the return value of readMagicNumbers(), which potentially left the value of 'sig2' uninitialized. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
This commit is contained in:
parent
a06e85f6ce
commit
cdd6852709
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,9 @@ Database* KdbxReader::readDatabase(QIODevice* device, const CompositeKey& key, b
|
||||||
|
|
||||||
// read KDBX magic numbers
|
// read KDBX magic numbers
|
||||||
quint32 sig1, sig2;
|
quint32 sig1, sig2;
|
||||||
readMagicNumbers(&headerStream, sig1, sig2, m_kdbxVersion);
|
if (!readMagicNumbers(&headerStream, sig1, sig2, m_kdbxVersion)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
m_kdbxSignature = qMakePair(sig1, sig2);
|
m_kdbxSignature = qMakePair(sig1, sig2);
|
||||||
|
|
||||||
// mask out minor version
|
// mask out minor version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue