summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-03-15 14:22:24 +0100
committerThomas Haller <thaller@redhat.com>2021-03-16 09:55:48 +0100
commit80c98b60da364e8449547bdb2901c85c721496be (patch)
tree0daa87ceed4c7f3658a2cba9086ff21157485415
parentec6e9f0cac8f1d307a59a4541e0b9783c0a7fcca (diff)
downloadNetworkManager-80c98b60da364e8449547bdb2901c85c721496be.tar.gz
libnm: make list of valid s390s options const
A const global variable is stored in immutable memory. You thus get a crash trying to modify it, which is desirable. The user is really not supposed to modify this buffer, even if nm_setting_wired_get_valid_s390_options() wrongly returns a non-const pointer.
-rw-r--r--src/libnm-core-impl/nm-setting-wired.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c
index 11fbcec41c..2bd123450b 100644
--- a/src/libnm-core-impl/nm-setting-wired.c
+++ b/src/libnm-core-impl/nm-setting-wired.c
@@ -74,7 +74,7 @@ G_DEFINE_TYPE(NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)
/*****************************************************************************/
-static const char *valid_s390_opts[] = {
+static const char *const valid_s390_opts[] = {
"bridge_role",
"broadcast_mode",
"buffer_count",
@@ -680,7 +680,7 @@ _nm_setting_wired_clear_s390_options(NMSettingWired *setting)
const char **
nm_setting_wired_get_valid_s390_options(NMSettingWired *setting)
{
- return valid_s390_opts;
+ return (const char **) valid_s390_opts;
}
/**