| Bug #106627 | mysql_service_mysql_string_iterator value in validate_password_policy_strength | ||
|---|---|---|---|
| Submitted: | 3 Mar 2022 1:46 | Modified: | 3 Mar 2022 13:58 |
| Reporter: | bin wang (OCA) | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Options | Severity: | S3 (Non-critical) |
| Version: | OS: | Any | |
| Assigned to: | CPU Architecture: | Any | |
[3 Mar 2022 1:54]
bin wang
suggested add patch
Attachment: validate_password_imp.patch (application/octet-stream, text), 900 bytes.
[3 Mar 2022 13:58]
MySQL Verification Team
Hi Mr. Wang, Thank you for your bug report. However, this is not a bug. According to the currently valid standard for C programming language, which is C18 standard, boolean false can be treated as zero, interchangeably. Not a bug.

Description: in mysql-8.0.28\components\validate_password\validate_password_imp.cc while (mysql_service_mysql_string_iterator->iterator_get_next( iter, &out_iter_char) == 0) { ............. Function Call in include\mysql\components\services\mysql_string.h ........... @retval false success @retval true failure */ DECLARE_BOOL_METHOD(iterator_get_next, (my_h_string_iterator iter, int *out_char)); ......... DECLARE_BOOL_METHOD return a bool value but '0' is a integer . How to repeat: DECLARE_BOOL_METHOD return a bool value is true or false but in while (mysql_service_mysql_string_iterator->iterator_get_next( iter, &out_iter_char) == 0) { is equal to integer change this return value to a boolean will be better Suggested fix: in mysql-8.0.28\components\validate_password\validate_password_imp.cc -- while (mysql_service_mysql_string_iterator->iterator_get_next( iter, &out_iter_char) == 0) { ++ while (mysql_service_mysql_string_iterator->iterator_get_next( iter, &out_iter_char) == false) {