X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-evt.c;h=a75cbbcc2a9ce00aa139300dbec1415adb8fec23;hb=60cd11786766ebc148b7ec088962dd6e112f8762;hp=0467bef11c6e26c99902b64cc0239c1ea6980979;hpb=16f014ef35b8355de1006891fe6920c8b51675fe;p=src%2Fapp-framework-binder.git diff --git a/src/afb-evt.c b/src/afb-evt.c index 0467bef1..a75cbbcc 100644 --- a/src/afb-evt.c +++ b/src/afb-evt.c @@ -86,7 +86,7 @@ struct afb_evtid { int id; /* fullname of the event */ - char fullname[1]; + char fullname[]; }; /* @@ -296,7 +296,7 @@ struct afb_evtid *afb_evt_evtid_create(const char *fullname) /* allocates the event */ len = strlen(fullname); - evtid = malloc(len + sizeof * evtid); + evtid = malloc(len + 1 + sizeof * evtid); if (evtid == NULL) goto error;