winedump: Don't crash on an invalid nrestab NE header value.

This commit is contained in:
Alexandre Julliard 2010-06-30 21:03:32 +02:00
parent 9bdd0272ce
commit 009c59afb8
1 changed files with 3 additions and 3 deletions

View File

@ -151,12 +151,12 @@ static void dump_ne_names( const IMAGE_OS2_HEADER *ne )
} }
if (ne->ne_cbnrestab) if (ne->ne_cbnrestab)
{ {
unsigned int pos = ne->ne_nrestab;
printf( "\nNon-resident name table:\n" ); printf( "\nNon-resident name table:\n" );
pstr = PRD(ne->ne_nrestab, 0); while ((pstr = PRD(pos, 0)) && *pstr)
while (*pstr)
{ {
printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr, pstr + 1 ); printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr, pstr + 1 );
pstr += *pstr + 1 + sizeof(WORD); pos += *pstr + 1 + sizeof(WORD);
} }
} }
} }