+2007-06-05 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gkeyfile.c (g_key_file_is_key_name):
+ (g_key_file_is_group_name): Don't assume the string is
+ valid UTF-8, since it may be user data. (#444161, Ben Combee)
+
2007-06-05 Behdad Esfahbod <behdad@gnome.org>
* glib/gutf8.c: Add not to g_utf8_get_char_validated() about
p = q = (gchar *) name;
while (*q && *q != ']' && *q != '[' && !g_ascii_iscntrl (*q))
- q = g_utf8_next_char (q);
+ q = g_utf8_find_next_char (q, NULL);
if (*q != '\0' || q == p)
return FALSE;
* since gnome-vfs uses mime-types as keys in its cache.
*/
while (*q && *q != '=' && *q != '[' && *q != ']')
- q = g_utf8_next_char (q);
+ q = g_utf8_find_next_char (q, NULL);
/* No empty keys, please */
if (q == p)
if (*q == '[')
{
q++;
- while (*q && (g_unichar_isalnum (g_utf8_get_char (q)) || *q == '-' || *q == '_' || *q == '.' || *q == '@'))
- q = g_utf8_next_char (q);
+ while (*q && (g_unichar_isalnum (g_utf8_get_char_validated (q, -1)) || *q == '-' || *q == '_' || *q == '.' || *q == '@'))
+ q = g_utf8_find_next_char (q, NULL);
if (*q != ']')
return FALSE;
p++;
while (*p && *p != ']')
- p = g_utf8_next_char (p);
+ p = g_utf8_find_next_char (p, NULL);
if (*p != ']')
return FALSE;
/* silently accept whitespace after the ] */
- p = g_utf8_next_char (p);
+ p = g_utf8_find_next_char (p, NULL);
while (*p == ' ' || *p == '\t')
- p = g_utf8_next_char (p);
+ p = g_utf8_find_next_char (p, NULL);
if (*p)
return FALSE;
GError **error)
{
gchar *end_of_valid_int;
- glong long_value;
+ glong long_value;
gint int_value;
errno = 0;