From 7200572b393534a2f503b810180276d2ae809c7a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 21 Nov 2017 18:11:36 +0100 Subject: QMimeMagicRule: fix inconsequential out-of-bounds access The penultimate entry in mimeRuleTypes_strings is "byte", which, incl. the terminating NUL character, has length five. But 65-59 == 6, so the last index in magicRuleType_indices was off by one. No harm done, since there's one more NUL (three in total...), but fix for the next reader of the code. Change-Id: Ibdf855014a313a0486d013c9d06d55cea96435fd Reviewed-by: Thiago Macieira --- src/corelib/mimetypes/qmimemagicrule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/mimetypes') diff --git a/src/corelib/mimetypes/qmimemagicrule.cpp b/src/corelib/mimetypes/qmimemagicrule.cpp index 5bbf1bba9d..6356a3581b 100644 --- a/src/corelib/mimetypes/qmimemagicrule.cpp +++ b/src/corelib/mimetypes/qmimemagicrule.cpp @@ -65,7 +65,7 @@ static const char magicRuleTypes_string[] = "\0"; static const int magicRuleTypes_indices[] = { - 0, 8, 15, 22, 29, 35, 41, 50, 59, 65, 0 + 0, 8, 15, 22, 29, 35, 41, 50, 59, 64, 0 }; QMimeMagicRule::Type QMimeMagicRule::type(const QByteArray &theTypeName) -- cgit v1.2.3