mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
fix possible crash in case null pointer is passed to QCryptographicHash::addData()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f1bbf0c42e
commit
c228fd6100
1 changed files with 2 additions and 4 deletions
|
@ -165,11 +165,9 @@ void QCryptographicHash::addData(const char *data, int length)
|
||||||
*/
|
*/
|
||||||
bool QCryptographicHash::addData(QIODevice* device)
|
bool QCryptographicHash::addData(QIODevice* device)
|
||||||
{
|
{
|
||||||
if (!device->isReadable())
|
if (!device || !device->isReadable() || !device->isOpen()) {
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!device->isOpen())
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QSTACKARRAY(char, buffer, QT_BUFFSIZE);
|
QSTACKARRAY(char, buffer, QT_BUFFSIZE);
|
||||||
int length;
|
int length;
|
||||||
|
|
Loading…
Add table
Reference in a new issue