]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Correctly handle failed crypto_early_init
authorteor <teor2345@gmail.com>
Sat, 13 Jun 2015 11:28:02 +0000 (21:28 +1000)
committerNick Mathewson <nickm@torproject.org>
Wed, 17 Jun 2015 13:18:32 +0000 (09:18 -0400)
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 [new file with mode: 0644]
src/or/main.c

diff --git a/changes/bug16360-failed-crypto-early-init b/changes/bug16360-failed-crypto-early-init
new file mode 100644 (file)
index 0000000..21972bc
--- /dev/null
@@ -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".
index 9c1cabf03762990df14f160acf14e4f500d5708e..031f758f453587a159f5e6b9f7abd274ae53ab54 100644 (file)
@@ -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. */