diff options
| author | Fergus Dall <sidereal@google.com> | 2021-06-22 19:31:26 +1000 |
|---|---|---|
| committer | Fergus Dall <sidereal@google.com> | 2021-06-22 20:15:39 +1000 |
| commit | ccc9612e823601f9bb7675bf2b029fd6eed6ed7b (patch) | |
| tree | 41155da2455aac4c9ca8a37f2853b56af6aaf244 /src/connection.c | |
| parent | connection-test: Encode size in message headers correctly (diff) | |
| download | wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar.gz wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar.bz2 wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar.lz wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar.xz wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.tar.zst wayland-ccc9612e823601f9bb7675bf2b029fd6eed6ed7b.zip | |
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>
Diffstat (limited to 'src/connection.c')
| -rw-r--r-- | src/connection.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 69190a1..ccbb972 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; |
