ifcfg-rh: fix potential crash with variadic argument make_ip6_setting()

It is undefined behavior and can lead to crashes or memory corruption.
In practice, this only had an issue on Big Endian systems.

Fixes: fdbf4ae5e6 ('ifcfg-rh: add IPV4_DHCP_TIMEOUT key for ipv4.dhcp-timeout property')
This commit is contained in:
Thomas Haller 2020-02-14 15:44:44 +01:00
parent d06092acbd
commit 9b82d29f5f

View file

@ -1734,7 +1734,7 @@ make_ip4_setting (shvarFile *ifcfg,
g_object_set (s_ip4,
NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, svGetValueBoolean (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXINT32, 0),
NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, (int) svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXINT32, 0),
NULL);
nm_clear_g_free (&value);