mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
connection: Error out if file descriptor was not received
Otherwise the tail of fds_in buffer would just shift beyond the beginning. That confuses the actual request handler and results in a crash further on due to corrupted tail. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
This commit is contained in:
parent
40d057f2c9
commit
360dca517a
1 changed files with 9 additions and 0 deletions
|
|
@ -744,6 +744,15 @@ wl_connection_demarshal(struct wl_connection *connection,
|
|||
p = next;
|
||||
break;
|
||||
case 'h':
|
||||
if (connection->fds_in.tail == connection->fds_in.head) {
|
||||
printf("file descriptor expected, "
|
||||
"object (%d), message %s(%s)\n",
|
||||
closure->sender_id, message->name,
|
||||
message->signature);
|
||||
errno = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
wl_buffer_copy(&connection->fds_in, &fd, sizeof fd);
|
||||
connection->fds_in.tail += sizeof fd;
|
||||
closure->args[i].h = fd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue