Avoid VLAs with size depending on user input
authorPino Toscano <ptoscano@redhat.com>
Thu, 30 Aug 2018 10:13:41 +0000 (12:13 +0200)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 30 Aug 2018 10:26:32 +0000 (11:26 +0100)
commitc27cacae2abac36e2ae89e3e354ec7b0ba8a70dc
tree5464fbdc217c8dfc7fd85efc64905367ac8898ad
parentabc8cb1b689390381964187481f523cfab60b21c
Avoid VLAs with size depending on user input

Do not use var-length arrays with sizes from user input (like
parameters), since they may grow the stack too much.

Instead, allocate the memory on the heap.
libvirt/generator.pl
libvirt/libvirt_c.c
libvirt/libvirt_c_oneoffs.c