Ensure that the Qt5Core library does not contain "QTMETADATA ".

In the event the plugin loader encounters it due to some configuration
problem, it is otherwise detected as a plugin causing a crash
when trying to read the meta data.

Task-number: QTBUG-35970

Change-Id: I34182b3a61125e3b192dfd4b1dc03bd1e98c693e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-07 10:55:49 +02:00 committed by The Qt Project
parent f0f6c1d0ed
commit 131a511194

View File

@ -256,7 +256,8 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
*/
bool hasMetaData = false;
long pos = 0;
const char pattern[] = "QTMETADATA ";
char pattern[] = "qTMETADATA ";
pattern[0] = 'Q'; // Ensure the pattern "QTMETADATA" is not found in this library should QPluginLoader ever encounter it.
const ulong plen = qstrlen(pattern);
#if defined (Q_OF_ELF) && defined(Q_CC_GNU)
int r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);