diff options
author | Thomas Haller <thaller@redhat.com> | 2021-08-26 23:01:12 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-08-26 23:05:20 +0200 |
commit | bf13ec2df2080ccc8ee2df312c10f061405f6168 (patch) | |
tree | 3f0af3aef32e289aa15b114eee570fe0bc940f75 | |
parent | 222c070412bc4862237dd41b5f0236994e7df4f8 (diff) | |
download | NetworkManager-bf13ec2df2080ccc8ee2df312c10f061405f6168.tar.gz |
libnm: avoid printing NULL string at NMSettingBondPort.verify()
printf() is not guaranteed to properly handle NULL string,
although glibc will print "(null)".
Avoid that by not printing the currently set value. The error
message is anyway already very long.
-rw-r--r-- | src/libnm-core-impl/nm-setting-bond-port.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libnm-core-impl/nm-setting-bond-port.c b/src/libnm-core-impl/nm-setting-bond-port.c index 87a15462cc..5eb1bfd07f 100644 --- a/src/libnm-core-impl/nm-setting-bond-port.c +++ b/src/libnm-core-impl/nm-setting-bond-port.c @@ -89,11 +89,9 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have the slave-type set to '%s'. " - "Instead it is '%s'"), + _("A connection with a '%s' setting must have the slave-type set to '%s'"), NM_SETTING_BOND_PORT_SETTING_NAME, - NM_SETTING_BOND_SETTING_NAME, - slave_type); + NM_SETTING_BOND_SETTING_NAME); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, |