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 <riitta-leena.miettinen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
90f0d522bf
commit
0bc7f94bd8
@ -380,7 +380,7 @@ QLibraryScanResult QCoffPeParser::parse(QByteArrayView data, QString *errMsg)
|
|||||||
size_t offset = section->PointerToRawData;
|
size_t offset = section->PointerToRawData;
|
||||||
if (size_t end; qAddOverflow<size_t>(offset, section->SizeOfRawData, &end)
|
if (size_t end; qAddOverflow<size_t>(offset, section->SizeOfRawData, &end)
|
||||||
|| end > size_t(data.size()))
|
|| 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
|
DWORD type = section->Characteristics
|
||||||
& (IMAGE_SCN_CNT_CODE | IMAGE_SCN_CNT_INITIALIZED_DATA
|
& (IMAGE_SCN_CNT_CODE | IMAGE_SCN_CNT_INITIALIZED_DATA
|
||||||
|
@ -714,7 +714,7 @@ static QLibraryScanResult scanSections(QByteArrayView data, const ErrorMaker &er
|
|||||||
continue;;
|
continue;;
|
||||||
if (T::Off end; qAddOverflow(shdr->sh_offset, shdr->sh_size, &end)
|
if (T::Off end; qAddOverflow(shdr->sh_offset, shdr->sh_size, &end)
|
||||||
|| end > size_t(data.size())) {
|
|| 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"))
|
if (name != QLatin1String(".qtmetadata"))
|
||||||
|
@ -755,17 +755,17 @@ void tst_QPluginLoader::loadCorruptElfOldPlugin_data()
|
|||||||
|
|
||||||
// arbitrary section bounds checks
|
// arbitrary section bounds checks
|
||||||
// section index = 0 is usually a NULL section, so we try 1
|
// 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) {
|
[](H h, QFile *f) {
|
||||||
ElfShdr *s = getSection(h, 1);
|
ElfShdr *s = getSection(h, 1);
|
||||||
s->sh_offset = f->size();
|
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) {
|
[](H h, QFile *f) {
|
||||||
ElfShdr *s = getSection(h, 1);
|
ElfShdr *s = getSection(h, 1);
|
||||||
s->sh_size = f->size() + 1 - s->sh_offset;
|
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);
|
ElfShdr *s = getSection(h, 1);
|
||||||
s->sh_size = -sizeof(*s);
|
s->sh_size = -sizeof(*s);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user