summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-31 11:06:35 +0100
committerKristian Høgsberg <krh@bitplanet.net>2011-10-31 11:13:13 -0400
commit3f1063f92aa60cf93bca6a6b15a7f782b8df8f93 (patch)
tree86886d5248e936c62c2ddc46b3bc5320265f1e2f
parentf86338d611305fb84187298cbab5dfc78a698c99 (diff)
connection: Check object types in message parameters
-rw-r--r--src/connection.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c
index 1963314..a10508d 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -594,6 +594,16 @@ wl_connection_demarshal(struct wl_connection *connection,
goto err;
}
+ if (*object != NULL && message->types[i-2] != NULL &&
+ (*object)->interface != message->types[i-2]) {
+ printf("invalid object (%d), type (%s), "
+ "message %s(%s)\n",
+ *p, (*object)->interface->name,
+ message->name, message->signature);
+ errno = EINVAL;
+ goto err;
+ }
+
p++;
break;
case 'n':