mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 23:58:26 +02:00
* bus/desktop-file.c (parse_key_value): Ignore locales allowing
the parser to continue instead of returning error (bus_desktop_file_load): Do not free parser data when parse_section_start or parse_key_value fails because it was already freed by parser_free (patch from Carlos Garcia Campos <carlosgc at gnome.org>)
This commit is contained in:
parent
0ca96ec548
commit
9825929920
2 changed files with 23 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,4 +1,14 @@
|
|||
2005-11-30 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* bus/desktop-file.c (parse_key_value): Ignore locales allowing
|
||||
the parser to continue instead of returning error
|
||||
(bus_desktop_file_load): Do not free parser data when
|
||||
parse_section_start or parse_key_value fails because it was
|
||||
already freed by parser_free (patch from Carlos Garcia Campos
|
||||
<carlosgc at gnome.org>)
|
||||
|
||||
2005-11-30 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,
|
||||
dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c
|
||||
glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ parse_key_value (BusDesktopFileParser *parser, DBusError *error)
|
|||
|
||||
if (!_dbus_string_find (&parser->data, parser->pos, "\n", &line_end))
|
||||
line_end = parser->len;
|
||||
|
||||
|
||||
p = parser->pos;
|
||||
key_start = p;
|
||||
while (p < line_end &&
|
||||
|
|
@ -476,6 +476,17 @@ parse_key_value (BusDesktopFileParser *parser, DBusError *error)
|
|||
}
|
||||
|
||||
/* We ignore locales for now */
|
||||
if (p < line_end && _dbus_string_get_byte (&parser->data, p) == '[')
|
||||
{
|
||||
if (line_end == parser->len)
|
||||
parser->pos = parser->len;
|
||||
else
|
||||
parser->pos = line_end + 1;
|
||||
|
||||
parser->line_num += 1;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Skip space before '=' */
|
||||
while (p < line_end && _dbus_string_get_byte (&parser->data, p) == ' ')
|
||||
|
|
@ -647,14 +658,13 @@ bus_desktop_file_load (DBusString *filename,
|
|||
parser.pos = 0;
|
||||
parser.len = _dbus_string_get_length (&parser.data);
|
||||
parser.current_section = -1;
|
||||
|
||||
|
||||
while (parser.pos < parser.len)
|
||||
{
|
||||
if (_dbus_string_get_byte (&parser.data, parser.pos) == '[')
|
||||
{
|
||||
if (!parse_section_start (&parser, error))
|
||||
{
|
||||
_dbus_string_free (&parser.data);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -665,7 +675,6 @@ bus_desktop_file_load (DBusString *filename,
|
|||
{
|
||||
if (!parse_key_value (&parser, error))
|
||||
{
|
||||
_dbus_string_free (&parser.data);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue