summaryrefslogtreecommitdiff
path: root/bus/desktop-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'bus/desktop-file.c')
-rw-r--r--bus/desktop-file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bus/desktop-file.c b/bus/desktop-file.c
index ae441c5e..bfeb72e2 100644
--- a/bus/desktop-file.c
+++ b/bus/desktop-file.c
@@ -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))