summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordoug <>2015-07-20 03:28:04 +0000
committerdoug <>2015-07-20 03:28:04 +0000
commit84d60be075f21534ffae4e31dce9719742b6f7fa (patch)
treec7fe3ccfc760e178ab3805f30798f0ff6ce8746c /src
parent16adc6b400eff66c6588cceac433db40aa1956fe (diff)
downloadopenbsd-84d60be075f21534ffae4e31dce9719742b6f7fa.tar.gz
openbsd-84d60be075f21534ffae4e31dce9719742b6f7fa.tar.bz2
openbsd-84d60be075f21534ffae4e31dce9719742b6f7fa.zip
Check return value for ENGINE_ctrl and ENGINE_ctrl_cmd.
Fixes Coverity issue 21645. ok bcook@
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/apps.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c
index 230ebd5a42..d01f75c7cb 100644
--- a/src/usr.bin/openssl/apps.c
+++ b/src/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.c,v 1.30 2015/07/20 02:41:10 doug Exp $ */ 1/* $OpenBSD: apps.c,v 1.31 2015/07/20 03:28:04 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -1269,10 +1269,21 @@ setup_engine(BIO *err, const char *engine, int debug)
1269 return NULL; 1269 return NULL;
1270 } 1270 }
1271 if (debug) { 1271 if (debug) {
1272 ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM, 1272 if (ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
1273 0, err, 0); 1273 0, err, 0) <= 0) {
1274 BIO_printf(err, "Cannot set logstream for "
1275 "engine \"%s\"\n", engine);
1276 ERR_print_errors(err);
1277 ENGINE_free(e);
1278 return NULL;
1279 }
1280 }
1281 if (!ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1)) {
1282 BIO_printf(err, "can't set user interface\n");
1283 ERR_print_errors(err);
1284 ENGINE_free(e);
1285 return NULL;
1274 } 1286 }
1275 ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1);
1276 if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) { 1287 if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
1277 BIO_printf(err, "can't use that engine\n"); 1288 BIO_printf(err, "can't use that engine\n");
1278 ERR_print_errors(err); 1289 ERR_print_errors(err);