mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
connection: Clear correct args when clearing fds to -1
commit 52609ddf79 was intended to
set fds to -1 in the arg list, however it failed to account for
version information at the start of signatures.
Most noticably, this broke mesa's create_prime_buffer by setting
width to -1 instead of the fd, as the width was the argument
following the fd, and the version was one byte long.
This should close https://bugs.kde.org/show_bug.cgi?id=389200
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
118aaec480
commit
e5b52f673c
1 changed files with 5 additions and 2 deletions
|
|
@ -533,10 +533,13 @@ wl_argument_from_va_list(const char *signature, union wl_argument *args,
|
|||
static void
|
||||
wl_closure_clear_fds(struct wl_closure *closure)
|
||||
{
|
||||
const char *signature = closure->message->signature;
|
||||
struct argument_details arg;
|
||||
int i;
|
||||
|
||||
for (i = 0; closure->message->signature[i]; i++) {
|
||||
if (closure->message->signature[i] == 'h')
|
||||
for (i = 0; i < closure->count; i++) {
|
||||
signature = get_next_argument(signature, &arg);
|
||||
if (arg.type == 'h')
|
||||
closure->args[i].h = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue