This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do without on-stack variable length arrays.


Yes, I shall correct the description.

Is there some simple way that I can test elfutils with fortify or bound
checking tools?

How about using pointers and malloc or alloca, and indexing through the
pointers? That should avoid complaints from stronger bound checkers,
although static bound checking probably won't find bound error either.

Or is there other pattern preferred by elfutils?


On Fri, Sep 4, 2015 at 1:51 PM, Roland McGrath <roland@hack.frob.com> wrote:

> This is misstated.  VLAs are a standard feature.  What you're avoiding here
> is VLA members of structs and unions, which are a GNU extension.
>
> I also don't think you're doing it the ideal way.  A union of two arrays of
> length one is useless.  It might trigger complaints from  _FORTIFY_SOURCE
> or other such bounds-checking tools.
>
Yes, I shall correct the description.

Is there some simple way that I can test elfutils with fortify or bound checking tools?

How about using pointers and malloc or alloca, and indexing through the pointers? That should avoid complaints from stronger bound checkers,
although static bound checking probably won't find bound error either.

Or is there other pattern preferred by elfutils?


On Fri, Sep 4, 2015 at 1:51 PM, Roland McGrath <roland@hack.frob.com> wrote:
This is misstated.  VLAs are a standard feature.  What you're avoiding here
is VLA members of structs and unions, which are a GNU extension.

I also don't think you're doing it the ideal way.  A union of two arrays of
length one is useless.  It might trigger complaints from  _FORTIFY_SOURCE
or other such bounds-checking tools.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]