Protect against bogus string offsets

svn path=/trunk/; revision=13635
This commit is contained in:
Gé van Geldorp 2005-02-18 20:19:49 +00:00
parent 41475e9941
commit c53bc44bae

View file

@ -442,7 +442,8 @@ ConvertStabs(ULONG *SymbolsCount, PROSSYM_ENTRY *SymbolsBase,
{ {
case N_SO: case N_SO:
Name = (char *) StabStringsBase + StabEntry[i].n_strx; Name = (char *) StabStringsBase + StabEntry[i].n_strx;
if ('\0' == *Name || '/' == Name[strlen(Name) - 1] if (StabStringsLength < StabEntry[i].n_strx
||'\0' == *Name || '/' == Name[strlen(Name) - 1]
|| '\\' == Name[strlen(Name) - 1] || '\\' == Name[strlen(Name) - 1]
|| StabEntry[i].n_value < ImageBase) || StabEntry[i].n_value < ImageBase)
{ {