mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gkeyfilesettingsbackend: Disallow empty key or group names
These should never have been allowed; they will result in precondition failures from the `GKeyFile` later on in the code. A test will be added for this shortly. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
9d27c57f70
commit
a59247608f
@ -161,6 +161,13 @@ convert_path (GKeyfileSettingsBackend *kfsb,
|
||||
|
||||
last_slash = strrchr (key, '/');
|
||||
|
||||
/* Disallow empty group names or key names */
|
||||
if (key_len == 0 ||
|
||||
(last_slash != NULL &&
|
||||
(*(last_slash + 1) == '\0' ||
|
||||
last_slash == key)))
|
||||
return FALSE;
|
||||
|
||||
if (kfsb->root_group)
|
||||
{
|
||||
/* if a root_group was specified, make sure the user hasn't given
|
||||
|
Loading…
Reference in New Issue
Block a user