summaryrefslogtreecommitdiffstats
path: root/filter/test.conf
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-19 09:41:18 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-19 09:41:18 +0100
commitaa4612480424ad2fede0cd4ae4c7a893f61c6c0f (patch)
tree8241b7e72a8eb2f243f566cd81b072ccdb8ca183 /filter/test.conf
parent74e9331fe0892c4c96b4c4d7db3f14bb7e9d928e (diff)
downloadbird-aa4612480424ad2fede0cd4ae4c7a893f61c6c0f.tar
bird-aa4612480424ad2fede0cd4ae4c7a893f61c6c0f.zip
Clear local variables in filters and functions.
Fixes crash when used uninitialized variables. This problem was surprisingly tricky to fix.
Diffstat (limited to 'filter/test.conf')
-rw-r--r--filter/test.conf14
1 files changed, 13 insertions, 1 deletions
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";