mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
netconfig: Make sure gw is not NULL
strcmp behavior is undefined if one of the parameters is NULL. Server-id is a mandatory value and cannot be NULL. Gateway can be NULL in DHCP, so check that explicitly. Reported-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
This commit is contained in:
parent
2135a4f845
commit
224721e7f0
@ -594,7 +594,7 @@ static void netconfig_gateway_to_arp(struct netconfig *netconfig)
|
|||||||
gw = l_dhcp_lease_get_gateway(lease);
|
gw = l_dhcp_lease_get_gateway(lease);
|
||||||
server_mac = l_dhcp_lease_get_server_mac(lease);
|
server_mac = l_dhcp_lease_get_server_mac(lease);
|
||||||
|
|
||||||
if (strcmp(server_id, gw) || !server_mac)
|
if (!gw || strcmp(server_id, gw) || !server_mac)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
l_debug("Gateway MAC is known, setting into ARP cache");
|
l_debug("Gateway MAC is known, setting into ARP cache");
|
||||||
|
Loading…
Reference in New Issue
Block a user