qt6-bb10/src/corelib/plugin
Thiago Macieira d8962144b4 Fix calculation of the string tab size in QElfParser
First of all, we were using the wrong size variable: instead of the size
of the section, found in the section header, we were using the size of
each section entry in the section table. Since that's usually smaller,
we weren't hitting a problem.

Second, if the string table is the last thing in the file and there's
nothing else after it, not even padding, then offset + section_size can
be equal to the file size. In fact, the .shstrtab section is usually the
last one, as it contains the section names themselves, so it stands to
reason that it's the second to last thing written.

For generic linkers, the last data in the file is the section table
itself, so usually the file is larger by at least a kilobyte, which is
why we haven't hit this bug. It could only manifest as deciding that
certain specially-crafted but valid ELF files were invalid. I can't
think of a way to trick it into thinking an invalid ELF is valid.

That's another reason why this code needs to be rewritten with more
modern coding styles and actually using <elf.h>

Fixes: QTBUG-71443
Change-Id: I1bd327aeaf73421a8ec5fffd156162f2df5557b8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 04:37:43 +00:00
..
plugin.pri Plugins: store the metadata in CBOR instead of binary JSON 2018-09-01 15:19:39 +00:00
qelfparser_p.cpp Fix calculation of the string tab size in QElfParser 2018-11-28 04:37:43 +00:00
qelfparser_p.h Fix integer overflow in very long sections in ELF objects 2018-09-15 19:46:40 +00:00
qfactoryinterface.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qfactoryinterface.h Updated license headers 2016-01-15 12:25:24 +00:00
qfactoryloader.cpp Plugins: Save some architectural requirement flags 2018-09-01 15:19:46 +00:00
qfactoryloader_p.h Plugins: store the metadata in CBOR instead of binary JSON 2018-09-01 15:19:39 +00:00
qlibrary.cpp Plugins: store the metadata in CBOR instead of binary JSON 2018-09-01 15:19:39 +00:00
qlibrary.h Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qlibrary_p.h Use QT_CONFIG(library) instead of QT_NO_LIBRARY 2017-03-06 11:27:20 +00:00
qlibrary_unix.cpp Android: Fix crash 2018-09-03 08:21:47 +00:00
qlibrary_win.cpp Windows code: Fix clang-tidy warnings about C-style casts 2018-08-30 06:26:44 +00:00
qmachparser.cpp QPluginLoader: limit the amount of memory used when scanning plugins 2018-07-14 04:37:46 +00:00
qmachparser_p.h QPluginLoader: limit the amount of memory used when scanning plugins 2018-07-14 04:37:46 +00:00
qplugin.h Plugins: Save some architectural requirement flags 2018-09-01 15:19:46 +00:00
qplugin.qdoc Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00
qplugin_p.h Plugins: Save some architectural requirement flags 2018-09-01 15:19:46 +00:00
qpluginloader.cpp Plugins: store the metadata in CBOR instead of binary JSON 2018-09-01 15:19:39 +00:00
qpluginloader.h Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qsystemlibrary.cpp Windows code: Fix clang-tidy warnings about C-style casts 2018-08-30 06:26:44 +00:00
qsystemlibrary_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
quuid.cpp Merge remote-tracking branch 'origin/dev' into 5.11 2018-02-10 15:55:52 +01:00
quuid.h Merge remote-tracking branch 'origin/dev' into 5.11 2018-02-10 15:55:52 +01:00