From 0317dc2bb2223dd8a51fc8b54a69765764d094d3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 1 Jul 2011 11:56:09 -0400 Subject: Check return value of crypto_global_init in test.c This will let the unit tests fail in a less mystifying way if the crypto subsystem is b0rken, and will also make Coverity happier. CID # 429. --- src/test/test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/test/test.c') diff --git a/src/test/test.c b/src/test/test.c index 1db1546639..02d238e26d 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -1318,7 +1318,10 @@ main(int c, const char **v) } options->command = CMD_RUN_UNITTESTS; - crypto_global_init(0, NULL, NULL); + if (crypto_global_init(0, NULL, NULL)) { + printf("Can't initialize crypto subsystem; exiting.\n"); + return 1; + } rep_hist_init(); network_init(); setup_directory(); -- cgit v1.2.3-54-g00ecf