From 490911c6fa368692b4a6dfefdc2a1e253b40f7df Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 12 Dec 2017 10:49:09 +0100 Subject: [PATCH] platform: assert() for valid item in nm_platform_link_get_all() Coverity thinks that item might be NULL, but actually it cannot. Unclear how to avoid the false positive. (cherry picked from commit 62d4dba74bac791c06ba70547f81b78eab5b9dc5) --- src/platform/nm-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 70675579f9..c7ed90e3fd 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -667,6 +667,7 @@ skip: /* There is a loop, pop the first (remaining) element from the list. * This can happen for veth pairs where each peer is parent of the other end. */ item = NMP_OBJECT_CAST_LINK (links->pdata[first_idx]); + nm_assert (item); g_hash_table_remove (unseen, GINT_TO_POINTER (item->ifindex)); g_ptr_array_add (result, links->pdata[first_idx]); links->pdata[first_idx] = NULL;