mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-06 08:08:05 +02:00
Fix dbus-daemon crash due to invalid service file
dbus-daemon will crash due to invalid service file which key/value starts before section. In that situation, new_line() will try to access invalid address. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60853 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
ff641bdb2f
commit
0a76508672
1 changed files with 6 additions and 0 deletions
|
|
@ -688,6 +688,12 @@ bus_desktop_file_load (DBusString *filename,
|
|||
else if (is_blank_line (&parser) ||
|
||||
_dbus_string_get_byte (&parser.data, parser.pos) == '#')
|
||||
parse_comment_or_blank (&parser);
|
||||
else if (parser.current_section < 0)
|
||||
{
|
||||
dbus_set_error(error, DBUS_ERROR_FAILED,
|
||||
"invalid service file: key=value before [Section]");
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!parse_key_value (&parser, error))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue