-
Incident report
-
Resolution: Fixed
-
Major
-
1.9.0 (alpha)
-
None
-
Windows, Zabbix Agent 1.9 (r10124)
The 3rd argument of _itow_s() must be not size of counting byte but size of counting character.
When I compile with "define UNICODE", memory corruption occurs in _itow_s().
http://msdn.microsoft.com/en-us/library/0we9x30h(VS.80).aspx
Zabbix using _itow_s() in following code.
trunk/src/zabbix_agent/cpustat.c:76 in "init_cpu_collector()"
> for(i = 0 /* 0 : _Total; >0 : cpu */; i <= pcpus->count; i++) {
> if (i == 0)
> zbx_wsnprintf(cpu, sizeof(cpu), TEXT("_Total"));
> else
> _itow_s(i - 1, cpu, sizeof(cpu), 10);
I think it should be following.
trunk/src/zabbix_agent/cpustat.c:76 in "init_cpu_collector()"
> for(i = 0 /* 0 : _Total; >0 : cpu */; i <= pcpus->count; i++) {
> if (i == 0)
> zbx_wsnprintf(cpu, sizeof(cpu), TEXT("_Total"));
> else
> _itow_s(i - 1, cpu, sizeof(cpu)/sizeof(TCHAR), 10);