summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-06-07 14:05:38 +0200
committerTodd Short <todd.short@me.com>2023-06-10 19:23:59 -0400
commit82b81161de41fde034f0d19e2ccddf190e4d8baf (patch)
tree3edd1215e0f82bdd01e50577aca0df2aeb9ff5e1
parenta33842efa51ca3f021310e10f444afef1e779fee (diff)
Coverity 1528490: Avoid assignment of unused value of i
It is used only within the loop and initialized at the beginning
-rw-r--r--apps/s_server.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 7c18f9ad65..6d980c52e7 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2413,7 +2413,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
char *buf = NULL;
fd_set readfds;
int ret = 1, width;
- int k, i;
+ int k;
unsigned long l;
SSL *con = NULL;
BIO *sbio;
@@ -2600,6 +2600,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
else
width = s + 1;
for (;;) {
+ int i;
int read_from_terminal;
int read_from_sslcon;
@@ -2699,7 +2700,6 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
SSL_renegotiate(con);
i = SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n", i);
- i = 0; /* 13; */
continue;
}
if ((buf[0] == 'R') && ((buf[1] == '\n') || (buf[1] == '\r'))) {
@@ -2709,7 +2709,6 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
SSL_renegotiate(con);
i = SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n", i);
- i = 0; /* 13; */
continue;
}
if ((buf[0] == 'K' || buf[0] == 'k')
@@ -2719,7 +2718,6 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
: SSL_KEY_UPDATE_NOT_REQUESTED);
i = SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n", i);
- i = 0;
continue;
}
if (buf[0] == 'c' && ((buf[1] == '\n') || (buf[1] == '\r'))) {
@@ -2731,7 +2729,6 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
} else {
i = SSL_do_handshake(con);
printf("SSL_do_handshake -> %d\n", i);
- i = 0;
}
continue;
}