Fixed signed integer overflow #140
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we use ./zabbix_get args
(Where args in xxd utility:
00000000: 2d70 7320 2d73 2031 3131 3131 3131 3131 -ps -s 111111111
00000010: 3131 3131 3131 31e8 033a 3b20 2d6b 2003 1111111..:;.-k..), then we got integer signed overflow in signed integer overflow zbx_is_ip4():
{code:java}
ip.c:41:18: runtime error: signed integer overflow: 1111111111 * 10 cannot be represented in type 'int'
#0 0x555555667da0 in zbx_is_ip4 /zabbixnew/zabbix/src/libs/zbxip/ip.c:41:18
#1 0x5555555c534a in zbx_socket_connect /zabbixnew/zabbix/src/libs/zbxcomms/comms.c:524:17
#2 0x5555555c6905 in zbx_socket_create /zabbixnew/zabbix/src/libs/zbxcomms/comms.c:661:17
#3 0x5555555c6833 in zbx_tcp_connect /zabbixnew/zabbix/src/libs/zbxcomms/comms.c:712:9
#4 0x5555555c2a84 in get_value /zabbixnew/zabbix/src/zabbix_get/zabbix_get.c:275:24
#5 0x5555555c1eb0 in main /zabbixnew/zabbix/src/zabbix_get/zabbix_get.c:605:8
{code}
Problem is actual for upstream version. You can accept PR for fix it:
#140