mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-10 04:27:52 -05:00
conection: Handle demarshal errors a little less dramatically
This commit is contained in:
parent
728d09936f
commit
a8db57befa
1 changed files with 6 additions and 2 deletions
|
|
@ -509,13 +509,17 @@ wl_connection_demarshal(struct wl_connection *connection,
|
|||
count = strlen(message->signature) + 2;
|
||||
if (count > ARRAY_LENGTH(closure->types)) {
|
||||
printf("too many args (%d)\n", count);
|
||||
assert(0);
|
||||
errno = EINVAL;
|
||||
wl_connection_consume(connection, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extra_space = wl_message_size_extra(message);
|
||||
if (sizeof closure->buffer < size + extra_space) {
|
||||
printf("request too big, should malloc tmp buffer here\n");
|
||||
assert(0);
|
||||
errno = ENOMEM;
|
||||
wl_connection_consume(connection, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
closure->message = message;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue