X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=blobdiff_plain;f=src%2Fafb-api-dbus.c;fp=src%2Fafb-api-dbus.c;h=17e1eb021f308cdb230e7a3dd5365d9c4901caa8;hp=a9880350e94f71dc73efa951b903bd73a224df6b;hb=bc8929bec96e81a7f487d5689f52335b435f0e3e;hpb=75a6b9e42432e3503a69013624c786af35aed7af diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index a9880350..17e1eb02 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -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 {