diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-11-21 18:11:36 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2017-11-30 12:54:55 +0000 |
commit | 7200572b393534a2f503b810180276d2ae809c7a (patch) | |
tree | 3d0a53e697a558aa624ecde6667baf25262af236 /src/corelib/mimetypes | |
parent | 648840c617f8702bca1cd7162cdb17b5e24ec1d4 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes')
-rw-r--r-- | src/corelib/mimetypes/qmimemagicrule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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) |