Fedora 30 packaging fix issu
[src/app-framework-binder.git] / src / afb-stub-ws.c
index 5e57dba..0e777f5 100644 (file)
@@ -145,7 +145,7 @@ struct afb_stub_ws
        uint8_t is_client;
 
        /* the api name */
-       char apiname[1];
+       char apiname[];
 };
 
 static struct afb_proto_ws *afb_stub_ws_create_proto(struct afb_stub_ws *stubws, struct fdev *fdev, uint8_t server);
@@ -649,7 +649,7 @@ static void on_hangup(void *closure)
 
 static int enqueue_processing(struct afb_proto_ws *proto, void (*callback)(int signum, void* arg), void *arg)
 {
-       return jobs_queue(proto, 0, callback, arg);
+       return jobs_queue(NULL /* proto */, 0, callback, arg);
 }
 
 /*****************************************************/
@@ -673,7 +673,7 @@ static struct afb_stub_ws *afb_stub_ws_create(struct fdev *fdev, const char *api
 {
        struct afb_stub_ws *stubws;
 
-       stubws = calloc(1, sizeof *stubws + strlen(apiname));
+       stubws = calloc(1, sizeof *stubws + 1 + strlen(apiname));
        if (stubws == NULL)
                errno = ENOMEM;
        else {