OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f16680
)
warn when no data is provided but result is requested via QCryptographicHash::result()
author
Ivailo Monev
<xakepa10@gmail.com>
Tue, 20 Sep 2022 04:50:24 +0000
(07:50 +0300)
committer
Ivailo Monev
<xakepa10@gmail.com>
Tue, 20 Sep 2022 04:50:24 +0000
(07:50 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/network/kernel/qcryptographichash.cpp
patch
|
blob
|
history
diff --git
a/src/network/kernel/qcryptographichash.cpp
b/src/network/kernel/qcryptographichash.cpp
index
753c863
..
4af6c1f
100644
(file)
--- a/
src/network/kernel/qcryptographichash.cpp
+++ b/
src/network/kernel/qcryptographichash.cpp
@@
-258,7
+258,8
@@
bool QCryptographicHash::addData(QIODevice* device)
*/
QByteArray QCryptographicHash::result() const
{
- if (!d->rehash) {
+ if (Q_UNLIKELY(!d->rehash)) {
+ qWarning("QCryptographicHash::result called without any data");
return QByteArray();
}
@@
-292,6
+293,7
@@
QByteArray QCryptographicHash::result() const
}
}
+ Q_UNREACHABLE();
return QByteArray();
}
@@
-341,6
+343,7
@@
QByteArray QCryptographicHash::hash(const QByteArray &data, QCryptographicHash::
}
}
+ Q_UNREACHABLE();
return QByteArray();
}