diff --git a/src/common/backend/libpq/be-secure.cpp b/src/common/backend/libpq/be-secure.cpp index c2bb0b12ed3dd540d3f6611f09a2bddc175c3660..e9f7bf3d5c5ff46ed6b66a6c07e6de24a08823df 100644 --- a/src/common/backend/libpq/be-secure.cpp +++ b/src/common/backend/libpq/be-secure.cpp @@ -904,11 +904,11 @@ static void set_user_config_ssl_ciphers(const char* sslciphers) } else { cipherStr = (char*)strchr(sslciphers, ';'); /*if the sslciphers does not contain character ';',the count is 1*/ while (cipherStr != NULL) { - counter++; cipherStr++; if (*cipherStr == '\0') { break; } + counter++; cipherStr = strchr(cipherStr, ';'); } ciphers_list = (char**)palloc(counter * sizeof(char*));