summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2012-03-25 08:40:56 +0300
committerTanu Kaskinen <tanuk@iki.fi>2012-03-25 08:40:56 +0300
commite9d82afdea4fff19de97a53e5ee7a149b18301eb (patch)
treeaae6b391703ec1cf3ac793bbd01fc04e1b99d7bc /src
parent737a6180d44c3f4dbe9def42e38c47665b28af15 (diff)
downloadpulseaudio-e9d82afdea4fff19de97a53e5ee7a149b18301eb.tar.gz
dbus: Check method call signatures.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45815
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/protocol-dbus.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pulsecore/protocol-dbus.c b/src/pulsecore/protocol-dbus.c
index 6a0dcf344..03cebc1ea 100644
--- a/src/pulsecore/protocol-dbus.c
+++ b/src/pulsecore/protocol-dbus.c
@@ -468,10 +468,15 @@ static enum find_result_t find_handler(struct call_info *call_info) {
else if (!(call_info->iface_entry = pa_hashmap_get(call_info->obj_entry->interfaces, call_info->interface)))
return NO_SUCH_INTERFACE;
- else if ((call_info->method_handler = pa_hashmap_get(call_info->iface_entry->method_handlers, call_info->method)))
+ else if ((call_info->method_handler = pa_hashmap_get(call_info->iface_entry->method_handlers, call_info->method))) {
+ call_info->expected_method_sig = pa_hashmap_get(call_info->iface_entry->method_signatures, call_info->method);
+
+ if (!pa_streq(call_info->method_sig, call_info->expected_method_sig))
+ return INVALID_METHOD_SIG;
+
return FOUND_METHOD;
- else
+ } else
return NO_SUCH_METHOD;
} else { /* The method call doesn't contain an interface. */