X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-dbus.c;h=1f254d1608d6636f377be7f468f7c1a01dfcdab4;hb=dee418b4cfb259fd7b03ec61496421119a318d93;hp=dccfbbd81b59f211341de1dbc9ddeebeee0822e3;hpb=c330ecf92fef81fdb0471715326b8bc6b4d52bc6;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index dccfbbd8..1f254d16 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY #define _GNU_SOURCE @@ -666,7 +666,7 @@ struct origin struct afb_cred *cred; /* the origin */ - char name[1]; + char name[]; }; /* get the credentials for the message */ @@ -710,7 +710,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 {