Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/zbxsysinfo/win32/proc.c')
-rw-r--r--src/libs/zbxsysinfo/win32/proc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/zbxsysinfo/win32/proc.c b/src/libs/zbxsysinfo/win32/proc.c
index dedbea03361..ed7babb04d1 100644
--- a/src/libs/zbxsysinfo/win32/proc.c
+++ b/src/libs/zbxsysinfo/win32/proc.c
@@ -73,7 +73,10 @@ static int zbx_get_process_username(HANDLE hProcess, char *userName, char *sid)
int iUse, res = FAIL;
/* clean result; */
- *userName = *sid = '\0';
+ *userName = '\0';
+
+ if (NULL != sid)
+ *sid = '\0';
/* open the processes token */
if (0 == OpenProcessToken(hProcess, TOKEN_QUERY, &tok))