From aa4612480424ad2fede0cd4ae4c7a893f61c6c0f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 19 Mar 2010 09:41:18 +0100 Subject: Clear local variables in filters and functions. Fixes crash when used uninitialized variables. This problem was surprisingly tricky to fix. --- filter/test.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'filter/test.conf') diff --git a/filter/test.conf b/filter/test.conf index 395699b..8eeb5c3 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -75,7 +75,7 @@ clist l; p2 = prepend( p2, 1 ); print "Should be true: ", p2 ~ pm1, " ", p2, " ", pm1; - l = - empty -; +# l = - empty -; l = add( l, (1,2) ); l = add( l, (2,3) ); print "Community list (1,2) (2,3) ", l; @@ -124,6 +124,14 @@ function test_pxset(prefix set pxs) 11.0.0.0/10 ~ pxs, ",", 20.1.0.0/26 ~ pxs; } +function test_undef(int a) +int b; +{ + if a = 3 + then b = 4; + print "Defined: ", a, " ", b, " ", defined(b); +} + function __startup() int i; bool b; @@ -218,6 +226,10 @@ string s; print "1.2.3.4 = ", onetwo; + test_undef(2); + test_undef(3); + test_undef(2); + print "done"; quitbird; # print "*** FAIL: this is unreachable"; -- cgit v1.2.3