summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-12-03 03:02:39 +0100
committerDaniel Mack <zonque@gmail.com>2013-12-03 09:39:10 +0100
commitefdb465d70173acea9b1596ed4021f429513fa6b (patch)
tree37bf386206a9023b74e4ba4e8764488c8849f199
parenteb6999de4a2a0a943180254ed26e5c95ea6e85f3 (diff)
downloadkdbus-bus-efdb465d70173acea9b1596ed4021f429513fa6b.tar.gz
kdbus-bus-efdb465d70173acea9b1596ed4021f429513fa6b.tar.bz2
kdbus-bus-efdb465d70173acea9b1596ed4021f429513fa6b.zip
add sanity check to kdbus_conn_move_messages
-rw-r--r--connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/connection.c b/connection.c
index f29472fe40d..ba8b7d9aff3 100644
--- a/connection.c
+++ b/connection.c
@@ -938,6 +938,9 @@ int kdbus_conn_move_messages(struct kdbus_conn *conn_dst,
if (!(conn_src->flags & KDBUS_HELLO_STARTER))
return -EINVAL;
+ if (conn_src == conn_dst)
+ return -EINVAL;
+
mutex_lock(&conn_src->lock);
mutex_lock(&conn_dst->lock);