]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix crash after reload where a stats lookup could reference old key
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jan 2020 14:18:52 +0000 (15:18 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jan 2020 14:18:52 +0000 (15:18 +0100)
  cache and neg cache structures.

doc/Changelog
testdata/remote-threaded.tdir/remote-threaded.test
validator/validator.c

index 59f8b55215ed5ae490696cac1c827c90cba91dd2..8fd0e38aec7d2ab8c1175818b70668cf7ff77955 100644 (file)
@@ -3,6 +3,8 @@
          because dnscrypt-proxy (2.0.36) does not support the test setup
          any more, and also the config file format does not seem to have
          the appropriate keys to recreate that setup.
+       - Fix crash after reload where a stats lookup could reference old key
+         cache and neg cache structures.
 
 10 January 2020: Wouter
        - Fix the relationship between serve-expired and prefetch options,
index 7392fa9097ca7517e2510069410bcb06f4f97ad5..e2f6b2783aaa0ce8bdf5c1a433c08ccd1f960d30 100644 (file)
@@ -25,7 +25,7 @@ if grep "10.20.30.40" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -37,7 +37,7 @@ $PRE/unbound-control -c ub.conf blablargh
 if test $? -ne 1; then
        echo "wrong exit value on error."
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        exit 1
 else
@@ -61,7 +61,7 @@ if grep "5.6.7.8" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -72,6 +72,8 @@ echo "$PRE/unbound-control -c ub.conf stats"
 $PRE/unbound-control -c ub.conf stats > tmp.$$
 if test $? -ne 0; then
        echo "wrong exit value after success"
+       cat fwd.log
+       cat unbound.log
        exit 1
 fi
 if grep "^total.num.queries=[1-9][0-9]*$" tmp.$$; then
@@ -90,7 +92,7 @@ if test $? -ne 0; then
        exit 1
 fi
 
-# check syntax error in parse 
+# check syntax error in parse
 echo "$PRE/unbound-control -c ub.conf verbosity jkdf"
 $PRE/unbound-control -c ub.conf verbosity jkdf
 if test $? -ne 1; then
@@ -135,7 +137,7 @@ if grep "192.0.2.1" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -149,7 +151,7 @@ if grep "NXDOMAIN" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -169,7 +171,7 @@ if grep "NXDOMAIN" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -189,7 +191,7 @@ if grep "SERVFAIL" outfile; then
        echo "OK"
 else
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "Not OK"
        exit 1
@@ -216,7 +218,7 @@ else
        exit 1
 fi
 
-# test lookup 
+# test lookup
 echo "$PRE/unbound-control -c ub.conf lookup www.example.com"
 $PRE/unbound-control -c ub.conf lookup www.example.com
 if test $? -ne 0; then
@@ -282,7 +284,7 @@ done
 if kill -0 $UNBOUND_PID; then
        echo "still up!"
        echo "> cat logfiles"
-       cat fwd.log 
+       cat fwd.log
        cat unbound.log
        echo "not stopped, failure"
        exit 1
@@ -294,7 +296,7 @@ else
                        echo "lock-verify test worked."
                else
                        echo "lock-verify test failed."
-                       cat fwd.log 
+                       cat fwd.log
                        cat unbound.log
                        exit 1
                fi
@@ -302,7 +304,7 @@ else
 fi
 
 echo "> cat logfiles"
-cat fwd.log 
+cat fwd.log
 cat unbound.log
 echo "> OK"
 exit 0
index 1e052a0e28d009466a41c0f0aa12afd3dbd6c678..c3ca0a27da83ddcbda414f1b22246f06eaec26d5 100644 (file)
@@ -200,7 +200,9 @@ val_deinit(struct module_env* env, int id)
        anchors_delete(env->anchors);
        env->anchors = NULL;
        key_cache_delete(val_env->kcache);
+       env->key_cache = NULL;
        neg_cache_delete(val_env->neg_cache);
+       env->neg_cache = NULL;
        free(val_env->nsec3_keysize);
        free(val_env->nsec3_maxiter);
        free(val_env);