diff options
author | Simon McVittie <smcv@collabora.com> | 2017-12-12 14:05:04 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-01-11 18:35:20 +0000 |
commit | 9bb330d82ab2bf60b5ec27b2b3e01d40d872243e (patch) | |
tree | 6619ecc7049284c556a8b6d835f311524e0ae056 /bus/dispatch.c | |
parent | 138f51f94afc385fb902f00c808a682e43198dad (diff) | |
download | dbus-9bb330d82ab2bf60b5ec27b2b3e01d40d872243e.tar.gz |
dbus-daemon: Filter out unknown header fields
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r-- | bus/dispatch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c index 14bef989..4ae98b5e 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -34,6 +34,7 @@ #include "signals.h" #include "test.h" #include <dbus/dbus-internals.h> +#include <dbus/dbus-message-internal.h> #include <dbus/dbus-misc.h> #include <dbus/dbus-test-tap.h> #include <string.h> @@ -287,6 +288,15 @@ bus_dispatch (DBusConnection *connection, } } + /* Make sure the message does not have any header fields that we + * don't understand (or validate), so that we can add header fields + * in future and clients can assume that we have checked them. */ + if (!_dbus_message_remove_unknown_fields (message)) + { + BUS_SET_OOM (&error); + goto out; + } + service_name = dbus_message_get_destination (message); #ifdef DBUS_ENABLE_VERBOSE_MODE |