X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-stub-ws.c;h=f008c41871fc854b35a31bd059f1c4e61c116e6b;hb=c53b1b3433a9fcb0f4f3afe8eca1daf75d43673f;hp=5e57dba869ed658f586351d65a209583835192a5;hpb=0e5cddffc8222d504ef1fcc9a75581688fc48928;p=src%2Fapp-framework-binder.git diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c index 5e57dba8..f008c418 100644 --- a/src/afb-stub-ws.c +++ b/src/afb-stub-ws.c @@ -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); @@ -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 {