mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 22:25:55 +00:00
Ensure we handle filename == NULL in dlopen correctly. Closes #1058
This commit is contained in:
@@ -214,7 +214,7 @@ HookingInfo &GetHookInfo()
|
||||
|
||||
void *intercept_dlopen(const char *filename, int flag)
|
||||
{
|
||||
if(GetHookInfo().IsLibHook(filename))
|
||||
if(filename && GetHookInfo().IsLibHook(std::string(filename)))
|
||||
return dlopen(RENDERDOC_ANDROID_LIBRARY, flag);
|
||||
|
||||
return NULL;
|
||||
@@ -420,7 +420,7 @@ uint64_t suppressTLS = 0;
|
||||
|
||||
void process_dlopen(const char *filename, int flag)
|
||||
{
|
||||
if(!GetHookInfo().IsHooked(filename))
|
||||
if(filename && !GetHookInfo().IsHooked(std::string(filename)))
|
||||
{
|
||||
HOOK_DEBUG_PRINT("iterating after %s", filename);
|
||||
dl_iterate_phdr(dl_iterate_callback, NULL);
|
||||
|
||||
@@ -85,6 +85,9 @@ void plthook_lib(void *handle)
|
||||
|
||||
void *intercept_dlopen(const char *filename, int flag, void *ret)
|
||||
{
|
||||
if(filename == NULL)
|
||||
return ret;
|
||||
|
||||
if(flag & RTLD_DEEPBIND)
|
||||
plthook_lib(ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user