X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fafb-trace.c;h=0de78da52ab14118f3e7f7213a23afd02fa9a3cd;hb=60cd11786766ebc148b7ec088962dd6e112f8762;hp=802015fa3eee4ed9afbd2b18d3ef15d77bc68180;hpb=16f014ef35b8355de1006891fe6920c8b51675fe;p=src%2Fapp-framework-binder.git diff --git a/src/afb-trace.c b/src/afb-trace.c index 802015fa..0de78da5 100644 --- a/src/afb-trace.c +++ b/src/afb-trace.c @@ -67,7 +67,7 @@ /* struct for tags */ struct tag { struct tag *next; /* link to the next */ - char tag[1]; /* name of the tag */ + char tag[]; /* name of the tag */ }; /* struct for events */ @@ -1073,7 +1073,7 @@ static struct tag *trace_get_tag(struct afb_trace *trace, const char *name, int if (!tag && alloc) { /* creation if needed */ - tag = malloc(sizeof * tag + strlen(name)); + tag = malloc(sizeof * tag + 1 + strlen(name)); if (tag) { strcpy(tag->tag, name); tag->next = trace->tags;