mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-14 21:18:07 +02:00
merge: branch 'jv/coverity'
coverity: fix bugs found by static analysis https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2394
This commit is contained in:
commit
5ea7d65fd1
7 changed files with 15 additions and 13 deletions
|
|
@ -7149,7 +7149,9 @@ nm_device_controller_release_port(NMDevice *self,
|
|||
|
||||
info = find_port_info(self, port);
|
||||
|
||||
if (info->port_state == PORT_STATE_ATTACHED)
|
||||
if (!info)
|
||||
port_state_str = "(not registered)";
|
||||
else if (info->port_state == PORT_STATE_ATTACHED)
|
||||
port_state_str = "(attached)";
|
||||
else if (info->port_state == PORT_STATE_NOT_ATTACHED)
|
||||
port_state_str = "(not attached)";
|
||||
|
|
@ -7162,7 +7164,7 @@ nm_device_controller_release_port(NMDevice *self,
|
|||
"controller: release one port " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s",
|
||||
NM_HASH_OBFUSCATE_PTR(port),
|
||||
nm_device_get_iface(port),
|
||||
!info ? "(not registered)" : port_state_str,
|
||||
port_state_str,
|
||||
release_type == RELEASE_PORT_TYPE_CONFIG_FORCE
|
||||
? " (force-configure)"
|
||||
: (release_type == RELEASE_PORT_TYPE_CONFIG ? " (configure)" : "(no-config)"));
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ _ASSERT_dns_config_ip_data(const NMDnsConfigIPData *ip_data)
|
|||
gboolean has_default = FALSE;
|
||||
gsize i;
|
||||
|
||||
for (i = 0; ip_data->domains.search && ip_data->domains.search; i++) {
|
||||
for (i = 0; ip_data->domains.search && ip_data->domains.search[i]; i++) {
|
||||
const char *d = ip_data->domains.search[i];
|
||||
|
||||
d = nm_utils_parse_dns_domain(d, NULL);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ ip6_subnet_from_delegation(IP6PrefixDelegation *delegation, NMDevice *device)
|
|||
}
|
||||
|
||||
/* Check for out-of-prefixes condition */
|
||||
num_subnets = 1 << (64 - delegation->prefix.plen);
|
||||
num_subnets = (guint64) 1 << (64 - delegation->prefix.plen);
|
||||
if (nm_g_hash_table_size(delegation->map_subnet_id_to_ifindex) >= num_subnets) {
|
||||
_LOGD(LOGD_IP6,
|
||||
"ipv6-pd: no more prefixes in %s/%u",
|
||||
|
|
|
|||
|
|
@ -1401,7 +1401,7 @@ _ip_route_attribute_validate(const char *name,
|
|||
NM_CONNECTION_ERROR_FAILED,
|
||||
family == AF_INET ? _("'%s' is not a valid IPv4 address")
|
||||
: _("'%s' is not a valid IPv6 address"),
|
||||
string);
|
||||
addr);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -4082,13 +4082,12 @@ test_roundtrip_conversion(gconstpointer test_data)
|
|||
if (flag == NM_CONNECTION_SERIALIZE_ALL) {
|
||||
s_wg2 = NM_SETTING_WIREGUARD(
|
||||
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
|
||||
|
||||
if (flag == NM_CONNECTION_SERIALIZE_ALL)
|
||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
|
||||
else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET)
|
||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
|
||||
else
|
||||
g_assert_not_reached();
|
||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
|
||||
} else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET) {
|
||||
con2 = _connection_new_from_dbus_strict(con_var, FALSE);
|
||||
s_wg2 = NM_SETTING_WIREGUARD(
|
||||
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
|
||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ reader_read_all_connections_from_fw(Reader *reader, const char *sysfs_dir)
|
|||
|
||||
if (!nmi_ibft_update_connection_from_nic(connection, nic, &error)) {
|
||||
_LOGW(LOGD_CORE, "Unable to merge iBFT configuration: %s", error->message);
|
||||
g_error_free(error);
|
||||
g_clear_error(&error);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ nmt_wireguard_peer_list_add_peer(NmtWireguardPeerList *list)
|
|||
NmtNewtForm *editor;
|
||||
|
||||
editor = nmt_wireguard_peer_editor_new(priv->setting, peer);
|
||||
nm_wireguard_peer_unref(peer);
|
||||
|
||||
if (!editor)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue