diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2011-07-18 13:10:49 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-07-18 13:10:49 -0400 |
| commit | a8db57befa3263c6de24fd9762a4aec3b564d4d3 (patch) | |
| tree | 6fadd00718cb70fcc5d531870aabebd9f0e0fd2e | |
| parent | Fix segfault in client when demarshalling fails (diff) | |
| download | wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar.gz wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar.bz2 wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar.lz wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar.xz wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.tar.zst wayland-a8db57befa3263c6de24fd9762a4aec3b564d4d3.zip | |
conection: Handle demarshal errors a little less dramatically
| -rw-r--r-- | wayland/connection.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wayland/connection.c b/wayland/connection.c index 4f6a845..af9a90e 100644 --- a/wayland/connection.c +++ b/wayland/connection.c @@ -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; |
