mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 21:10:32 +01:00
libnm-util: warn if trying to set NULL VPN secrets
This commit is contained in:
parent
d61a312ca2
commit
e08db5cae5
1 changed files with 11 additions and 1 deletions
|
|
@ -316,8 +316,18 @@ update_secret_hash (NMSetting *setting,
|
|||
|
||||
/* Now add the items to the settings' secrets list */
|
||||
g_hash_table_iter_init (&iter, secrets);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &value))
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &value)) {
|
||||
if (value == NULL) {
|
||||
g_warn_if_fail (value != NULL);
|
||||
continue;
|
||||
}
|
||||
if (strlen (value) == 0) {
|
||||
g_warn_if_fail (strlen (value) > 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
g_hash_table_insert (priv->secrets, g_strdup (name), g_strdup (value));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue