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 d3fb846d8c in 0.2.5.2-alpha,
introduced when implementing #4900.

Patch by "teor".
This commit is contained in:
teor 2015-06-13 21:28:02 +10:00 committed by Nick Mathewson
parent 8aa04408fb
commit 75388f67c0
2 changed files with 8 additions and 1 deletions

View File

@ -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".

View 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. */