winedump: Be stricter about sizes while walking module's list.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
This commit is contained in:
Eric Pouech 2023-02-01 18:30:50 +01:00 committed by Alexandre Julliard
parent cda616d8ca
commit e8777691c8

View file

@ -637,6 +637,9 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx
/* Read per-module symbol / linenumber tables */
file = (const char*)symbols + sizeof(PDB_SYMBOLS);
while (file - (const char*)symbols < sizeof(PDB_SYMBOLS) + symbols->module_size)
while ((file - (const char*)symbols + sizeof(symbols->version) < sizeof(PDB_SYMBOLS) + symbols->module_size) &&
(file - (const char*)symbols +
symbols->version < 19970000 ? sizeof(PDB_SYMBOL_FILE) : sizeof(PDB_SYMBOL_FILE_EX)) < sizeof(PDB_SYMBOLS) + symbols->module_size)
{
int stream_nr, symbol_size, lineno_size, lineno2_size;
const char* file_name;