Skip to content

Commit 43899ec

Browse files
rlebretonwlallemand
authored andcommitted
BUG/MINOR: ssl: ssl_sock_prepare_ssl_ctx does not return an error code
The return value check was wrongly based on error codes when the function actually returns an error number. This bug was introduced by f3eedfe which is a feature not present before branch 2.4. It does not need to be backported.
1 parent bf1bd5a commit 43899ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ssl_ckch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,7 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
12591259
int y = 0;
12601260
char *err = NULL;
12611261
int errcode = 0;
1262+
int retval = 0;
12621263
struct ckch_store *old_ckchs, *new_ckchs = NULL;
12631264
struct ckch_inst *ckchi, *ckchis;
12641265
struct buffer *trash = alloc_trash_chunk();
@@ -1337,8 +1338,8 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
13371338
new_inst->server = ckchi->server;
13381339
/* Create a new SSL_CTX and link it to the new instance. */
13391340
if (new_inst->is_server_instance) {
1340-
errcode |= ssl_sock_prepare_srv_ssl_ctx(ckchi->server, new_inst->ctx);
1341-
if (errcode & ERR_CODE)
1341+
retval = ssl_sock_prepare_srv_ssl_ctx(ckchi->server, new_inst->ctx);
1342+
if (retval)
13421343
goto error;
13431344
}
13441345

0 commit comments

Comments
 (0)