summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-04-20 12:34:04 +0100
committerMatt Caswell <matt@openssl.org>2023-04-24 11:12:48 +0100
commit6799fc2409823939cde5b4a0da909e16ef78d3a8 (patch)
treefe188d007d27fb642c67500875c485d61fbfdb41 /apps
parentd748a1c6ac264ba74815e34c8d7a2ca478eb8b04 (diff)
downloadopenssl-new-6799fc2409823939cde5b4a0da909e16ef78d3a8.tar.gz
Coverity 1524619: unexpected control flow
Using "continue" in a do...while(0) loop is pointless. The original intent was that the loop would continue to a second iteration in this case. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20788)
Diffstat (limited to 'apps')
-rw-r--r--apps/s_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index b69d17faa1..c69b8e4058 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -3827,7 +3827,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len,
char *cmd_start = buf_start;
cmd_start[outlen] = '\0';
- do {
+ for (;;) {
cmd_start = strstr(cmd_start, "{");
if (cmd_start == buf_start && *(cmd_start + 1) == '{') {
/* The "{" is escaped, so skip it */
@@ -3838,7 +3838,8 @@ static int user_data_process(struct user_data_st *user_data, size_t *len,
outlen--;
continue;
}
- } while(0);
+ break;
+ }
if (cmd_start == buf_start) {
/* Command detected */