From: Matt Caswell Date: Thu, 20 Apr 2023 11:34:04 +0000 (+0100) Subject: Coverity 1524619: unexpected control flow X-Git-Tag: openssl-3.2.0-alpha1~978 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6799fc2409823939cde5b4a0da909e16ef78d3a8;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20788) --- diff --git a/apps/s_client.c b/apps/s_client.c index b69d17faa17..c69b8e40581 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 */