3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

ip-pool: Sanity check addr_str_list

This commit is contained in:
Denis Kenzior 2021-06-07 17:22:43 -05:00
parent c295fba546
commit 3dcf1fd9d8

View File

@ -143,6 +143,9 @@ int ip_pool_select_addr4(const char **addr_str_list, uint8_t subnet_prefix_len,
int err = -EINVAL; int err = -EINVAL;
char ipstr[INET_ADDRSTRLEN]; char ipstr[INET_ADDRSTRLEN];
if (!addr_str_list || !addr_str_list[0])
goto cleanup;
/* Build a sorted list of used/unavailable subnets */ /* Build a sorted list of used/unavailable subnets */
for (entry = l_queue_get_entries((struct l_queue *) used_addr4_list); for (entry = l_queue_get_entries((struct l_queue *) used_addr4_list);
entry; entry = entry->next) { entry; entry = entry->next) {