Ver Fonte

Fix null deref + reduce WIN32 API reqs

nosoop há 3 anos atrás
pai
commit
310179134b
2 ficheiros alterados com 2 adições e 1 exclusões
  1. 1 1
      memscan.cpp
  2. 1 0
      memscan.h

+ 1 - 1
memscan.cpp

@@ -94,7 +94,7 @@ bool CLinuxLibInfo::LocateSymbol(const char* name, void** result) {
 		gelf_getsym(data, i, &sym);
 		
 		const char *symname = elf_strptr(this->m_Elf, shdr.sh_link, sym.st_name);
-		if (!strcmp(symname, name)) {
+		if (symname && !strcmp(symname, name)) {
 			*result = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(m_info.dli_fbase) + sym.st_value);
 			return true;
 		}

+ 1 - 0
memscan.h

@@ -5,6 +5,7 @@
 #include <cstdint>
 
 #if WINDOWS
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #elif _LINUX
 #include "mmsplugin.h"