1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-18 19:13:51 +01:00

gnrc_netif: fix potential null pointer dereference

This commit is contained in:
Martine Lenders 2022-03-24 15:53:23 +01:00
parent d53f37546f
commit 624e8099ec
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -139,8 +139,8 @@ unsigned gnrc_netif_numof(void)
gnrc_netif_t *gnrc_netif_iter(const gnrc_netif_t *prev)
{
netif_t *result = netif_iter(&prev->netif);
return container_of(result, gnrc_netif_t, netif);
netif_t *result = netif_iter((prev) ? &prev->netif : NULL);
return (result) ? container_of(result, gnrc_netif_t, netif) : NULL;
}
gnrc_netif_t *gnrc_netif_get_by_type(netdev_type_t type, uint8_t index)