From 0bc7f94bd8949b89b75c2730a743a2bbf74a0c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Tue, 21 Dec 2021 12:42:43 +0100 Subject: [PATCH] Q*Parser: Replace "data" with "contents" in strings ...to be clearer and avoid confusion with "data section". Change-Id: I13319be0e3e12aecf1e0e86c256007dfe6cb98c6 Pick-to: 6.3 Reviewed-by: Leena Miettinen Reviewed-by: Thiago Macieira --- src/corelib/plugin/qcoffpeparser.cpp | 2 +- src/corelib/plugin/qelfparser_p.cpp | 2 +- .../auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/plugin/qcoffpeparser.cpp b/src/corelib/plugin/qcoffpeparser.cpp index 03eca7d2b67..4813a07b27f 100644 --- a/src/corelib/plugin/qcoffpeparser.cpp +++ b/src/corelib/plugin/qcoffpeparser.cpp @@ -380,7 +380,7 @@ QLibraryScanResult QCoffPeParser::parse(QByteArrayView data, QString *errMsg) size_t offset = section->PointerToRawData; if (size_t end; qAddOverflow(offset, section->SizeOfRawData, &end) || end > size_t(data.size())) - return error(QLibrary::tr("a section data extends past the end of the file")); + return error(QLibrary::tr("section contents extend past the end of the file")); DWORD type = section->Characteristics & (IMAGE_SCN_CNT_CODE | IMAGE_SCN_CNT_INITIALIZED_DATA diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index ed973e4323a..c6ccda92fbf 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -714,7 +714,7 @@ static QLibraryScanResult scanSections(QByteArrayView data, const ErrorMaker &er continue;; if (T::Off end; qAddOverflow(shdr->sh_offset, shdr->sh_size, &end) || end > size_t(data.size())) { - return error(QLibrary::tr("a section data extends past the end of the file")); + return error(QLibrary::tr("section contents extend past the end of the file")); } if (name != QLatin1String(".qtmetadata")) diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index 8c68cfde0d1..fcce21433ea 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -755,17 +755,17 @@ void tst_QPluginLoader::loadCorruptElfOldPlugin_data() // arbitrary section bounds checks // section index = 0 is usually a NULL section, so we try 1 - newRow("section1-starts-past-eof", "a section data extends past the end of the file", + newRow("section1-starts-past-eof", "section contents extend past the end of the file", [](H h, QFile *f) { ElfShdr *s = getSection(h, 1); s->sh_offset = f->size(); }); - newRow("section1-ends-past-eof", "a section data extends past the end of the file", + newRow("section1-ends-past-eof", "section contents extend past the end of the file", [](H h, QFile *f) { ElfShdr *s = getSection(h, 1); s->sh_size = f->size() + 1 - s->sh_offset; }); - newRow("section1-bounds-overflow", "a section data extends past the end of the file", [](H h) { + newRow("section1-bounds-overflow", "section contents extend past the end of the file", [](H h) { ElfShdr *s = getSection(h, 1); s->sh_size = -sizeof(*s); });