mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-16 22:05:55 -05:00
connection: Handle non-nullable strings in wl_connection_demarshal
Currently a null string passed into a non-nullable argument of a message will decode succesfully, probably resulting in the handler function crashing. Instead treat it the same way we do non-nullable objects and ids. Signed-off-by: Fergus Dall <sidereal@google.com>
This commit is contained in:
parent
4f53613e70
commit
ccc9612e82
2 changed files with 25 additions and 0 deletions
|
|
@ -749,6 +749,13 @@ wl_connection_demarshal(struct wl_connection *connection,
|
|||
case 's':
|
||||
length = *p++;
|
||||
|
||||
if (length == 0 && !arg.nullable) {
|
||||
wl_log("NULL string received on non-nullable "
|
||||
"type, message %s(%s)\n", message->name,
|
||||
message->signature);
|
||||
errno = EINVAL;
|
||||
goto err;
|
||||
}
|
||||
if (length == 0) {
|
||||
closure->args[i].s = NULL;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue