mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247741 - Additional checks for pointer validity in LdrLoadDLL detour. r=aklotz
This commit is contained in:
parent
b4c7567e87
commit
d9a89388aa
@ -486,7 +486,10 @@ getFullPath (PWCHAR filePath, wchar_t* fname)
|
||||
// path name. For example, its numerical value can be 1. Passing a non-valid
|
||||
// pointer to SearchPathW will cause a crash, so we need to check to see if we
|
||||
// are handed a valid pointer, and otherwise just pass nullptr to SearchPathW.
|
||||
PWCHAR sanitizedFilePath = (intptr_t(filePath) < 4096) ? nullptr : filePath;
|
||||
PWCHAR sanitizedFilePath = nullptr;
|
||||
if ((uintptr_t(filePath) >= 65536) && ((uintptr_t(filePath) & 1) == 0)) {
|
||||
sanitizedFilePath = filePath;
|
||||
}
|
||||
|
||||
// figure out the length of the string that we need
|
||||
DWORD pathlen = SearchPathW(sanitizedFilePath, fname, L".dll", 0, nullptr,
|
||||
|
Loading…
Reference in New Issue
Block a user