From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- tools/winedump/minidump.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/winedump/minidump.c b/tools/winedump/minidump.c index 80057a21829..fddfd0e45fe 100644 --- a/tools/winedump/minidump.c +++ b/tools/winedump/minidump.c @@ -76,7 +76,7 @@ void mdmp_dump(void)
if (!hdr) { - printf("Cannot get Minidump header\n"); + printf("Corrupt file, cannot get Minidump header\n"); return; }
@@ -89,13 +89,21 @@ void mdmp_dump(void) printf(" TimeDateStamp: %s\n", get_time_str(hdr->TimeDateStamp)); printf("Flags: %s\n", get_hexint64_str(hdr->Flags));
+ if (!PRD(hdr->StreamDirectoryRva, hdr->NumberOfStreams * sizeof(MINIDUMP_DIRECTORY))) + { + printf("Corrupt file, can't read all minidump directories\n"); + return; + } for (idx = 0; idx < hdr->NumberOfStreams; ++idx) { dir = PRD(hdr->StreamDirectoryRva + idx * sizeof(MINIDUMP_DIRECTORY), sizeof(*dir)); - if (!dir) break;
stream = PRD(dir->Location.Rva, dir->Location.DataSize); - + if (!stream) + { + printf("Stream [%u]: corrupt file, stream is larger that file\n", idx); + continue; + } switch (dir->StreamType) { case UnusedStream:
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- tools/winedump/minidump.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/tools/winedump/minidump.c b/tools/winedump/minidump.c index fddfd0e45fe..d8010ea0159 100644 --- a/tools/winedump/minidump.c +++ b/tools/winedump/minidump.c @@ -854,6 +854,36 @@ void mdmp_dump(void) } } break; + case CommentStreamA: + { + /* MSDN states an ANSI string, so stopping at first '\0' if any */ + const char *end = memchr(stream, '\0', dir->Location.DataSize); + printf("Stream [%u]: CommentA\n", idx); + printf("--- start of comment\n"); + write(1, stream, end ? end - (const char*)stream : dir->Location.DataSize); + printf("--- end of comment\n"); + if (globals_dump_sect("content")) + dump_mdmp_data(&dir->Location, " "); + } + break; + case CommentStreamW: + { + const WCHAR *ptr; + + /* MSDN states an UNICODE string, so stopping at first L'\0' if any */ + printf("Stream [%u]: CommentW\n", idx); + printf("--- start of comment\n"); + for (ptr = stream; ptr + 1 <= (const WCHAR *)((const char *)stream + dir->Location.DataSize) && *ptr; ptr++) + { + if (*ptr== L'\n' || *ptr== L'\r' || *ptr== L'\t' || (*ptr >= L' ' && *ptr < 127)) + putchar((char)*ptr); + else printf("\u%04x", *ptr); + } + printf("--- end of comment\n"); + if (globals_dump_sect("content")) + dump_mdmp_data(&dir->Location, " "); + } + break; default: printf("Stream [%u]: NIY %d\n", idx, dir->StreamType); printf(" RVA: %#x\n", (UINT)dir->Location.Rva);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147053
Your paranoid android.
=== debian11b (64 bit WoW report) ===
ddraw: ddraw1.c:3645: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31969).