mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-31 02:28:54 -04:00
Merge branch 'release/2.4.2' into develop
This commit is contained in:
commit
63aab99b9c
25 changed files with 541 additions and 63 deletions
|
@ -35,7 +35,7 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
{
|
||||
Q_ASSERT(m_kdbxVersion == KeePass2::FILE_VERSION_4);
|
||||
|
||||
m_binaryPoolInverse.clear();
|
||||
m_binaryPool.clear();
|
||||
|
||||
if (hasError()) {
|
||||
return false;
|
||||
|
@ -273,11 +273,7 @@ bool Kdbx4Reader::readInnerHeaderField(QIODevice* device)
|
|||
return false;
|
||||
}
|
||||
auto data = fieldData.mid(1);
|
||||
if (m_binaryPoolInverse.contains(data)) {
|
||||
qWarning("Skipping duplicate binary record");
|
||||
break;
|
||||
}
|
||||
m_binaryPoolInverse.insert(data, QString::number(m_binaryPoolInverse.size()));
|
||||
m_binaryPool.insert(QString::number(m_binaryPool.size()), data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -422,17 +418,5 @@ QVariantMap Kdbx4Reader::readVariantMap(QIODevice* device)
|
|||
*/
|
||||
QHash<QString, QByteArray> Kdbx4Reader::binaryPool() const
|
||||
{
|
||||
QHash<QString, QByteArray> binaryPool;
|
||||
for (auto it = m_binaryPoolInverse.cbegin(); it != m_binaryPoolInverse.cend(); ++it) {
|
||||
binaryPool.insert(it.value(), it.key());
|
||||
}
|
||||
return binaryPool;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mapping from binary data to attachment keys
|
||||
*/
|
||||
QHash<QByteArray, QString> Kdbx4Reader::binaryPoolInverse() const
|
||||
{
|
||||
return m_binaryPoolInverse;
|
||||
return m_binaryPool;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ public:
|
|||
const QByteArray& headerData,
|
||||
QSharedPointer<const CompositeKey> key,
|
||||
Database* db) override;
|
||||
QHash<QByteArray, QString> binaryPoolInverse() const;
|
||||
QHash<QString, QByteArray> binaryPool() const;
|
||||
|
||||
protected:
|
||||
|
@ -44,7 +43,7 @@ private:
|
|||
bool readInnerHeaderField(QIODevice* device);
|
||||
QVariantMap readVariantMap(QIODevice* device);
|
||||
|
||||
QHash<QByteArray, QString> m_binaryPoolInverse;
|
||||
QHash<QString, QByteArray> m_binaryPool;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_KDBX4READER_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue