Details
-
Type:
Patch request
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 3.0.11rc1, 3.2.7, 3.4.2rc1, 4.0.0alpha1
-
Fix Version/s: 3.0.11rc1, 3.2.8rc1, 3.4.2rc1, 4.0.0alpha1, 4.0 (plan)
-
Component/s: Agent (G)
-
Environment:Windows 10 Pro 64-Bit Build 15063
-
Team:Team A
-
Sprint:Sprint 15, Sprint 16
-
Story Points:3
Description
I was compiling the source code using the Windows NMake file and added the /MTd switch instead of the /MT compiler switch so I could debug the source code. When I tried to run the code then I encountered a heap corruption. I tracked the issue down to the zbx_mutex_create_per_process_name function in the src/libs/zbxsys/mutexs.c source file. You can see how I did it in the attached source file. I also corrected the issue and commented out the original line. According to the Microsoft documentation (https://msdn.microsoft.com/en-us/library/f30dzcf6.aspx) the second parameter of the _snwprintf_s function is the count of characters and not the size of the buffer in bytes.