mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-29 11:56:13 -04:00
Fix memory leak in SymmetricCipherStream.
This commit is contained in:
parent
f9abf2171b
commit
7063f5296a
@ -21,11 +21,12 @@ SymmetricCipherStream::SymmetricCipherStream(QIODevice* baseDevice, SymmetricCip
|
|||||||
SymmetricCipher::Mode mode, SymmetricCipher::Direction direction,
|
SymmetricCipher::Mode mode, SymmetricCipher::Direction direction,
|
||||||
const QByteArray& key, const QByteArray& iv)
|
const QByteArray& key, const QByteArray& iv)
|
||||||
: LayeredStream(baseDevice)
|
: LayeredStream(baseDevice)
|
||||||
|
, m_cipher(new SymmetricCipher(algo, mode, direction, key, iv))
|
||||||
, m_bufferPos(0)
|
, m_bufferPos(0)
|
||||||
, m_bufferFilling(false)
|
, m_bufferFilling(false)
|
||||||
, m_error(false)
|
, m_error(false)
|
||||||
{
|
{
|
||||||
m_cipher = new SymmetricCipher(algo, mode, direction, key, iv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SymmetricCipherStream::~SymmetricCipherStream()
|
SymmetricCipherStream::~SymmetricCipherStream()
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define KEEPASSX_SYMMETRICCIPHERSTREAM_H
|
#define KEEPASSX_SYMMETRICCIPHERSTREAM_H
|
||||||
|
|
||||||
#include <QtCore/QByteArray>
|
#include <QtCore/QByteArray>
|
||||||
|
#include <QtCore/QScopedPointer>
|
||||||
|
|
||||||
#include "crypto/SymmetricCipher.h"
|
#include "crypto/SymmetricCipher.h"
|
||||||
#include "streams/LayeredStream.h"
|
#include "streams/LayeredStream.h"
|
||||||
@ -42,7 +43,7 @@ private:
|
|||||||
bool readBlock();
|
bool readBlock();
|
||||||
bool writeBlock();
|
bool writeBlock();
|
||||||
|
|
||||||
SymmetricCipher* m_cipher;
|
const QScopedPointer<SymmetricCipher> m_cipher;
|
||||||
QByteArray m_buffer;
|
QByteArray m_buffer;
|
||||||
int m_bufferPos;
|
int m_bufferPos;
|
||||||
bool m_bufferFilling;
|
bool m_bufferFilling;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user