[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] _virtualboxCreateMachine: Avoid unbound stack



On Sat, Mar 05, 2016 at 14:05:31 +0100, Michal Privoznik wrote:
> If the stars are in the right position and you're building with

One would think that electron alignment in the material of your SSD that
creates the bits that finally align to the file creating the software on
your machine would cause this ... I'm not sure that star alignment has
to do much with it.

> VBox >= 4.2.0 it will happen that compiler thinks an array
> allocated on the stack may be unbound:

There's quite a substantial semantic difference between "unbound" and

> In file included from vbox/vbox_V4_2.c:13:0:
> vbox/vbox_tmpl.c: In function '_virtualboxCreateMachine':
> vbox/vbox_tmpl.c:2811:1: error: stack usage might be unbounded [-Werror=stack-usage=]
 
... unbounded. I'd suggest you get your language straight. Plus one
other instance in the subhect.

>  _virtualboxCreateMachine(vboxGlobalData *data, virDomainDefPtr def, IMachine **machine, char *uuidstr ATTRIBUTE_UNUSED)
>  ^
> 
> Well, given how the variable is declared, I had some hard time
> seeing it is actually bounded. Surprisingly compiler does not

Here it's correct!

> complain because of -Wframe-larger-than. This is because
> variable length arrays do not count into that warning.
> 
> Signed-off-by: Michal Privoznik <mprivozn redhat com>
> ---
>  src/vbox/vbox_tmpl.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)

ACK, the original code was a mess ...

Peter

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]