pidl:Python: protect for loops against $length being an expression instead of a scala...
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Jun 2015 06:54:11 +0000 (08:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 12 Jun 2015 15:08:19 +0000 (17:08 +0200)
commit781cc3d50f18e69bad5faf67ee46f7b1fd28cf2a
tree2279c3df32a19ee360b8f83b3b5c3b580d115ca5
parentad7148fec650c10fa77daf73ece57a8dfa37eb63
pidl:Python: protect for loops against $length being an expression instead of a scalar variable

This changes

for (value_cntr_1 = 0; value_cntr_1 < r->out.length?*r->out.length:0; value_cntr_1++) {

into:

for (value_cntr_1 = 0; value_cntr_1 < (r->out.length?*r->out.length:0); value_cntr_1++) {

it fixes a possible endless loop resulting in a crash.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
pidl/lib/Parse/Pidl/Samba4/Python.pm