[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.2] Check return of init_keys() ip_address_changed: fix Coverity CID 484



commit 2412e0e4024325608b551f74140e449d2016916f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Oct 6 12:59:25 2011 -0400

    Check return of init_keys() ip_address_changed: fix Coverity CID 484
---
 changes/cov484 |    4 ++++
 src/or/main.c  |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/changes/cov484 b/changes/cov484
new file mode 100644
index 0000000..33adbda
--- /dev/null
+++ b/changes/cov484
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Report any failure in init_keys() calls done because our IP address
+      has changed. Spotted by Coverity Scan. Bugfix on 0.1.1.4-alpha;
+      fixes CID 484.
diff --git a/src/or/main.c b/src/or/main.c
index 289d805..c011c9b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1378,7 +1378,8 @@ ip_address_changed(int at_interface)
   if (at_interface) {
     if (! server) {
       /* Okay, change our keys. */
-      init_keys();
+      if (init_keys()<0)
+        log_warn(LD_GENERAL, "Unable to rotate keys after IP change!");
     }
   } else {
     if (server) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits