From fca1b60ce7cc199c8185301c97848b9bb06ed3b3 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 8 Jan 2015 17:06:40 +0100 Subject: [PATCH] handle: properly reset output arguments to 0 Make sure all output arguments are set to 0 so we can copy them once we're done with the ioctl, regardless whether they were set previously. Signed-off-by: David Herrmann --- handle.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/handle.c b/handle.c index 8729cdd..b1a1e8e 100644 --- a/handle.c +++ b/handle.c @@ -687,6 +687,9 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd, break; cmd_send->return_flags = 0; + cmd_send->reply.offset = 0; + cmd_send->reply.msg_size = 0; + cmd_send->reply.return_flags = 0; ret = kdbus_items_validate(cmd_send->items, KDBUS_ITEMS_SIZE(cmd_send, items)); @@ -749,6 +752,10 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd, break; cmd_recv->return_flags = 0; + cmd_recv->dropped_msgs = 0; + cmd_recv->reply.offset = 0; + cmd_recv->reply.msg_size = 0; + cmd_recv->reply.return_flags = 0; ret = kdbus_items_validate(cmd_recv->items, KDBUS_ITEMS_SIZE(cmd_recv, items)); -- 2.34.1