forked from wolfSSL/wolfssl
Move assignment to after the null check
This commit is contained in:
@@ -1764,12 +1764,13 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
|
|||||||
byte havePSK = 0;
|
byte havePSK = 0;
|
||||||
byte haveAnon = 0;
|
byte haveAnon = 0;
|
||||||
byte haveRSA = 0;
|
byte haveRSA = 0;
|
||||||
byte newSSL = ssl->ctx == NULL;
|
|
||||||
(void) haveAnon; /* Squash unused var warnings */
|
(void) haveAnon; /* Squash unused var warnings */
|
||||||
|
|
||||||
if(!ssl || !ctx || ssl->suites == NULL)
|
if(!ssl || !ctx || ssl->suites == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
byte newSSL = ssl->ctx == NULL; /* Assign after null check */
|
||||||
|
|
||||||
#ifndef NO_PSK
|
#ifndef NO_PSK
|
||||||
if (ctx->server_hint[0] && ssl->arrays == NULL) {
|
if (ctx->server_hint[0] && ssl->arrays == NULL) {
|
||||||
return BAD_FUNC_ARG; /* needed for copy below */
|
return BAD_FUNC_ARG; /* needed for copy below */
|
||||||
|
Reference in New Issue
Block a user