Bug 623407 - g_keyfile_settings_backend_new crash
authorRyan Lortie <desrt@desrt.ca>
Fri, 2 Jul 2010 15:35:43 +0000 (11:35 -0400)
committerRyan Lortie <desrt@desrt.ca>
Fri, 2 Jul 2010 15:35:43 +0000 (11:35 -0400)
commita16128655fed37a3975fdb8ea0d31ef0fa29e882
treed8c4cf8c9c5c6a06be4429c1bd6284cc9dc049c7
parenta941660873ad4db42f1799e444d46d95721af840
Bug 623407 - g_keyfile_settings_backend_new crash

The keyfile backend forms paths like this:

  prefix + group_name + '/' + keyname

If the prefix is '/apps/yelp/' and the group name is '/' then this means
that we end up with a key name of (for example):

  '/apps/yelp/' + '/' + '/' + 'font-adjustment'

= '/apps/yelp///font-adjustment'

which is obviously not a valid key name.

This patch rejects group names starting or ending with '/' or containing
'//' and also rejects keys containing '/'.  This should make it
impossible for invalid keys to be formed.
gio/gkeyfilesettingsbackend.c