X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-dbus.c;h=966c9656b24988fb3f58ed39e9b6c3db9297aba1;hb=a445694bda8773cb80566808b5dcb56f033dee58;hp=a9880350e94f71dc73efa951b903bd73a224df6b;hpb=e39610f8c9b2e6bbb8a460f7d7ccccbc5161b4ed;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index a9880350..966c9656 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -634,7 +634,7 @@ error: static void afb_api_dbus_server_event_add(void *closure, const char *event, int eventid); static void afb_api_dbus_server_event_remove(void *closure, const char *event, int eventid); static void afb_api_dbus_server_event_push(void *closure, const char *event, int eventid, struct json_object *object); -static void afb_api_dbus_server_event_broadcast(void *closure, const char *event, int eventid, struct json_object *object); +static void afb_api_dbus_server_event_broadcast(void *closure, const char *event, struct json_object *object); /* the interface for events broadcasting */ static const struct afb_evt_itf evt_broadcast_itf = { @@ -665,7 +665,7 @@ struct origin struct afb_cred *cred; /* the origin */ - char name[1]; + char name[]; }; /* get the credentials for the message */ @@ -709,7 +709,7 @@ static struct origin *afb_api_dbus_server_origin_get(struct api_dbus *api, const } /* not found, create it */ - origin = malloc(strlen(sender) + sizeof *origin); + origin = malloc(strlen(sender) + 1 + sizeof *origin); if (origin == NULL) errno = ENOMEM; else { @@ -916,7 +916,7 @@ static void afb_api_dbus_server_event_push(void *closure, const char *event, int json_object_put(object); } -static void afb_api_dbus_server_event_broadcast(void *closure, const char *event, int eventid, struct json_object *object) +static void afb_api_dbus_server_event_broadcast(void *closure, const char *event, struct json_object *object) { int rc; struct api_dbus *api;