From a19bb6018426e36a3f61ac4e623e97932a080b39 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 13 Jun 2014 16:27:34 -0400 Subject: [PATCH] added MD5 sanity check --- openbr/plugins/gallery.cpp | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index c4b40da..b51f73d 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -207,6 +207,9 @@ class utGallery : public BinaryGallery dst += bytesRead; } + if (QCryptographicHash::hash(data, QCryptographicHash::Md5) != QByteArray((const char*)ut->templateID, 16)) + qFatal("MD5 hash check failure!"); + if (ut->algorithmID == 5) { QDataStream stream(&data, QIODevice::ReadOnly); stream >> t; -- libgit2 0.21.4