server: Fail to bind object when requested version is 0
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 14 Jan 2016 19:33:52 +0000 (13:33 -0600)
committerBryce Harrington <bryce@bryceharrington.org>
Tue, 2 Feb 2016 01:26:08 +0000 (17:26 -0800)
0 is not a valid version number for registry bind requests, so
let's check for it in registry_bind.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
src/wayland-server.c

index 3ba8a5d..ae9365f 100644 (file)
@@ -730,6 +730,11 @@ registry_bind(struct wl_client *client,
                wl_resource_post_error(resource,
                                       WL_DISPLAY_ERROR_INVALID_OBJECT,
                                       "invalid global %s (%d)", interface, name);
+       else if (version == 0)
+               wl_resource_post_error(resource,
+                                      WL_DISPLAY_ERROR_INVALID_OBJECT,
+                                      "invalid version for global %s (%d): 0 is not a valid version",
+                                      interface, name);
        else if (global->version < version)
                wl_resource_post_error(resource,
                                       WL_DISPLAY_ERROR_INVALID_OBJECT,