]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Coverity 1524619: unexpected control flow
authorMatt Caswell <matt@openssl.org>
Thu, 20 Apr 2023 11:34:04 +0000 (12:34 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 24 Apr 2023 10:12:48 +0000 (11:12 +0100)
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)

apps/s_client.c

index b69d17faa1793ebe5e1302d0dc43f2ae25fd8d5f..c69b8e40581a6a768e306e7fc96b906383501d64 100644 (file)
@@ -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 */