Commits
dimir authored 859d12982aa
...G...... [ZBX-9847] fix possible Zabbix agent crash when executing system.cpu.discovery
The fix is in file src/zabbix_agent/cpustat.c function get_cpus().
get_cpustat_by_num() can return NULL.
Before this fix:
1. In case CPUs in the system are not named sequentially starting from
0 system.cpu.discovery would crash.
2. The {#CPU.NUMBER} value in returned JSON would correspond to the ID
of CPU (0 in case of first CPU) which is not suitable for item
prototype where it is expected to be CPU ID + 1.
After this fix:
1. system.cpu.discovery would never crash the agent.
2. The {#CPU.NUMBER} in the returned JSON has correct value for item
prototype.
[svn merge -c r55780 ^/branches/2.4]