From 1a6ac8319313b6e024305397512513387afcafb8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 27 Sep 2015 11:43:47 -0700 Subject: Ensure there's no sign-extension here. Both e_shentsize and e_shtrndx are ELF half-words, which means C integers of rank less than int (they're quint16). That means this multiplcation was done actually as int, due to integer promotion from unsigned short. So preempt the integer promotion and force them to full- word integers (unsigned int). While the bit-pattern result of the multiplication is the same, the addition with e_shoff (a qelfoff_t = quintptr) wouldn't: the promotion from 32-bit int to 64-bit would first execute a sign-extension. Now, this shouldn't happen on regular ELF files, but it cause QLibrary to crash if a specially-crafted (or simply corrupt) plugin is found. Found by Coverity, CID 22642 Change-Id: I42e7ef1a481840699a8dffff1407e9f1282eeecf Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/plugin/qelfparser_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/plugin') diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index d93be439e0..3798231383 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -148,7 +148,7 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library #endif ElfSectionHeader strtab; - qulonglong soff = e_shoff + e_shentsize * (e_shtrndx); + qulonglong soff = e_shoff + qelfword_t(e_shentsize) * qelfword_t(e_shtrndx); if ((soff + e_shentsize) > fdlen || soff % 4 || soff == 0) { if (lib) -- cgit v1.2.3 From d49169ae890bcf4f341b7c2f36b875668f063de6 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 29 Sep 2015 13:36:16 +0200 Subject: Doc: replace \target with \keyword if at start of page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A \target whose purpose is to link to the top of a page (and not to a section within a page) works better as a \keyword, because \target generates a new html anchor which, in this case, is not tied to any title element on the page. A \keyword links to the page itself, as expected. Task-number: QTBUG-48482 Change-Id: I957551edd0eb7e665358d04b37dab41e2686b851 Reviewed-by: Topi Reiniƶ --- src/corelib/plugin/qplugin.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/plugin') diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc index 94f5bc8a30..00ecb30430 100644 --- a/src/corelib/plugin/qplugin.qdoc +++ b/src/corelib/plugin/qplugin.qdoc @@ -28,7 +28,7 @@ /*! \headerfile \title Defining Plugins - \target qtplugin-defining-plugins + \keyword qtplugin-defining-plugins \ingroup plugins \brief The header file defines macros for defining plugins. -- cgit v1.2.3 From 690f9a7e74701e64db1035ccb11673942988d927 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 10 Oct 2015 23:40:58 +0200 Subject: QtCore: use QStringRef in more places Apart from removing some unwanted allocations, also reduces text size by ~800B on Linux AMD64 GCC 4.9 release builds. Change-Id: Ibcd1d8264f54f2b165b69bee8aa50ff7f4ad3a10 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/plugin/qpluginloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/plugin') diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index 292ad30525..24101be87b 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -286,9 +286,9 @@ static QString locatePlugin(const QString& fileName) suffixes.prepend(QString()); // Split up "subdir/filename" - const int slash = fileName.lastIndexOf('/'); - const QString baseName = fileName.mid(slash + 1); - const QString basePath = isAbsolute ? QString() : fileName.left(slash + 1); // keep the '/' + const int slash = fileName.lastIndexOf(QLatin1Char('/')); + const QStringRef baseName = fileName.midRef(slash + 1); + const QStringRef basePath = isAbsolute ? QStringRef() : fileName.leftRef(slash + 1); // keep the '/' const bool debug = qt_debug_component(); -- cgit v1.2.3