Commit a19bb6018426e36a3f61ac4e623e97932a080b39
1 parent
63e26f14
added MD5 sanity check
Showing
1 changed file
with
3 additions
and
0 deletions
openbr/plugins/gallery.cpp
| @@ -207,6 +207,9 @@ class utGallery : public BinaryGallery | @@ -207,6 +207,9 @@ class utGallery : public BinaryGallery | ||
| 207 | dst += bytesRead; | 207 | dst += bytesRead; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | + if (QCryptographicHash::hash(data, QCryptographicHash::Md5) != QByteArray((const char*)ut->templateID, 16)) | ||
| 211 | + qFatal("MD5 hash check failure!"); | ||
| 212 | + | ||
| 210 | if (ut->algorithmID == 5) { | 213 | if (ut->algorithmID == 5) { |
| 211 | QDataStream stream(&data, QIODevice::ReadOnly); | 214 | QDataStream stream(&data, QIODevice::ReadOnly); |
| 212 | stream >> t; | 215 | stream >> t; |