From: Eric Bollengier Date: Tue, 2 Jun 2020 11:42:07 +0000 (+0200) Subject: win32: Fix org#2547 About possible NULL pointer dereference in get_memory_info X-Git-Tag: Release-9.6.4~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fa0f3496fc18b0e2b47fb0d216045b386235c7e;p=thirdparty%2Fbacula.git win32: Fix org#2547 About possible NULL pointer dereference in get_memory_info --- diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 16ea1578a..c5b2b248c 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -2920,6 +2920,9 @@ uint64_t get_memory_info(char *buf, int buflen) uint64_t ret=0; HANDLE hProcess = GetCurrentProcess(); PROCESS_MEMORY_COUNTERS pmc; + if (!buf) { + return ret; + } buf[0] = '\0'; if (p_GetProcessMemoryInfo) {