Make sure that there is extra information in the exception record

before accessing it in check_resource_write.
This commit is contained in:
Alexandre Julliard 2004-01-28 21:40:01 +00:00
parent 5e07be4eb0
commit 23ff2d51a7
1 changed files with 1 additions and 0 deletions

View File

@ -415,6 +415,7 @@ inline static BOOL check_resource_write( const EXCEPTION_RECORD *rec )
MEMORY_BASIC_INFORMATION info; MEMORY_BASIC_INFORMATION info;
if (rec->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) return FALSE; if (rec->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) return FALSE;
if (rec->NumberParameters < 2) return FALSE;
if (!rec->ExceptionInformation[0]) return FALSE; /* not a write access */ if (!rec->ExceptionInformation[0]) return FALSE; /* not a write access */
addr = (void *)rec->ExceptionInformation[1]; addr = (void *)rec->ExceptionInformation[1];
if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE; if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE;