mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 23:30:28 +01:00
cli: fix potential crash in nmcli when using strcmp
Error found by running Coverity https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
7fd4d35463
commit
0139ad37f7
1 changed files with 3 additions and 3 deletions
|
|
@ -461,7 +461,7 @@ find_connection (GSList *list, const char *filter_type, const char *filter_val)
|
|||
|| ( (!filter_type || strcmp (filter_type, "uuid") == 0)
|
||||
&& strcmp (filter_val, uuid) == 0)
|
||||
|| ( (!filter_type || strcmp (filter_type, "path") == 0)
|
||||
&& (strcmp (filter_val, path) == 0 || (filter_type && g_strcmp0 (filter_val, path_num) == 0))))
|
||||
&& (g_strcmp0 (filter_val, path) == 0 || (filter_type && g_strcmp0 (filter_val, path_num) == 0))))
|
||||
return connection;
|
||||
|
||||
iterator = g_slist_next (iterator);
|
||||
|
|
@ -734,9 +734,9 @@ find_active_connection (const GPtrArray *active_cons, const GSList *cons,
|
|||
|| ( (!filter_type || strcmp (filter_type, "uuid") == 0)
|
||||
&& strcmp (filter_val, uuid) == 0)
|
||||
|| ( (!filter_type || strcmp (filter_type, "path") == 0)
|
||||
&& (strcmp (filter_val, path) == 0 || (filter_type && g_strcmp0 (filter_val, path_num) == 0)))
|
||||
&& (g_strcmp0 (filter_val, path) == 0 || (filter_type && g_strcmp0 (filter_val, path_num) == 0)))
|
||||
|| ( (!filter_type || strcmp (filter_type, "apath") == 0)
|
||||
&& (strcmp (filter_val, a_path) == 0 || (filter_type && g_strcmp0 (filter_val, a_path_num) == 0))))
|
||||
&& (g_strcmp0 (filter_val, a_path) == 0 || (filter_type && g_strcmp0 (filter_val, a_path_num) == 0))))
|
||||
return candidate;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue