[tor-commits] [tor/maint-0.2.6] Correctly handle failed crypto_early_init

nickm at torproject.org nickm at torproject.org
Wed Jun 17 13:19:01 UTC 2015


commit 75388f67c07d1a48c6fb9c5d1c4441ab66b644c0
Author: teor <teor2345 at gmail.com>
Date:   Sat Jun 13 21:28:02 2015 +1000

    Correctly handle failed crypto_early_init
    
    If crypto_early_init fails, a typo in a return value from tor_init
    means that tor_main continues running, rather than returning
    an error value.
    
    Fixes bug 16360; bugfix on d3fb846d8c98 in 0.2.5.2-alpha,
    introduced when implementing #4900.
    
    Patch by "teor".
---
 changes/bug16360-failed-crypto-early-init |    7 +++++++
 src/or/main.c                             |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/changes/bug16360-failed-crypto-early-init b/changes/bug16360-failed-crypto-early-init
new file mode 100644
index 0000000..21972bc
--- /dev/null
+++ b/changes/bug16360-failed-crypto-early-init
@@ -0,0 +1,7 @@
+  o Minor bugfixes (crypto error-handling):
+    - If crypto_early_init fails, a typo in a return value from tor_init
+      means that tor_main continues running, rather than returning
+      an error value.
+      Fixes bug 16360; bugfix on d3fb846d8c98 in 0.2.5.2-alpha,
+      introduced when implementing #4900.
+      Patch by "teor".
diff --git a/src/or/main.c b/src/or/main.c
index 9c1cabf..031f758 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2346,7 +2346,7 @@ tor_init(int argc, char *argv[])
   /* Set up the crypto nice and early */
   if (crypto_early_init() < 0) {
     log_err(LD_GENERAL, "Unable to initialize the crypto subsystem!");
-    return 1;
+    return -1;
   }
 
   /* Initialize the history structures. */





More information about the tor-commits mailing list