Fix false ***buffer overflow*** detection 82/20882/1
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 2 Apr 2019 14:49:09 +0000 (16:49 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 2 Apr 2019 14:49:09 +0000 (16:49 +0200)
commit60cd11786766ebc148b7ec088962dd6e112f8762
tree212ec4b02261dbe8730a61b7bf66d8a61f9699ef
parent16f014ef35b8355de1006891fe6920c8b51675fe
Fix false ***buffer overflow*** detection

The compiling option __FORTIFY_SOURCE=2 introduced
a false ***buffer overflow*** detection when the
flexible array 'pattern' was initilized in globset.

The compiler is only complaining when the array is
in a struct that is in a struct like

 struct { ...; struct { ...; char name[1]; }}

To avoid these false detections, it is enougth
to ellipsese the dimension of the array. Seems
to be the now standard way of declaring flexible
arrays when it was before an extension. So now:

 struct { ...; struct { ...; char name[]; }}

works even when __FORTIFY_SOURCE=2.

Bug-AGL: SPEC-2292

Change-Id: I4b4a5df505a5357f92b9ab1657175911198ca582
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
12 files changed:
conf.d/packaging/rpm/agl-app-framework-binder.spec
src/afb-api-dbus.c
src/afb-api-ws.c
src/afb-apiset.c
src/afb-evt.c
src/afb-export.c
src/afb-hsrv.c
src/afb-stub-ws.c
src/afb-trace.c
src/globset.c
src/globset.h
src/locale-root.c