connection: abort if a listener function is NULL
authorRyo Munakata <ryomnktml@gmail.com>
Wed, 1 Oct 2014 12:17:18 +0000 (21:17 +0900)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 12 Nov 2014 12:00:38 +0000 (14:00 +0200)
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/connection.c

index f9f2474..2545194 100644 (file)
@@ -934,6 +934,11 @@ wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
                     count + 2, &ffi_type_void, ffi_types);
 
        implementation = target->implementation;
+       if (!implementation[opcode]) {
+               wl_log("listener function for opcode %u of %s is NULL\n",
+                       opcode, target->interface->name);
+               abort();
+       }
        ffi_call(&cif, implementation[opcode], NULL, ffi_args);
 }