mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
warn if QCryptographicHash::hash() is called with empty data
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ac0689a666
commit
35205fd485
1 changed files with 4 additions and 0 deletions
|
@ -198,6 +198,10 @@ QByteArray QCryptographicHash::result() const
|
|||
*/
|
||||
QByteArray QCryptographicHash::hash(const QByteArray &data)
|
||||
{
|
||||
if (Q_UNLIKELY(data.isEmpty())) {
|
||||
qWarning("QCryptographicHash::hash called without any data");
|
||||
return QByteArray();
|
||||
}
|
||||
QCryptographicHashPrivate kathash;
|
||||
kathash.update(data.constData(), data.length());
|
||||
return kathash.result();
|
||||
|
|
Loading…
Add table
Reference in a new issue