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.
This commit is contained in:
Thomas Haller 2021-03-15 14:22:24 +01:00
parent ec6e9f0cac
commit 80c98b60da
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;
}
/**