From e4edd2da4546f18d399aaaa0f647c30023f89a67 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 28 Oct 2023 23:27:11 +0300 Subject: [PATCH] platform/posix: check for non-zero dladdr ret --- engine/platform/posix/lib_posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/platform/posix/lib_posix.c b/engine/platform/posix/lib_posix.c index 29172cd4..f3086597 100644 --- a/engine/platform/posix/lib_posix.c +++ b/engine/platform/posix/lib_posix.c @@ -212,8 +212,8 @@ const char *COM_NameForFunction( void *hInstance, void *function ) // NOTE: dladdr() is a glibc extension { Dl_info info = {0}; - dladdr( (void*)function, &info ); - if( info.dli_sname ) + int ret = dladdr( (void*)function, &info ); + if( ret && info.dli_sname ) return COM_GetPlatformNeutralName( info.dli_sname ); } #ifdef XASH_ALLOW_SAVERESTORE_OFFSETS