Bug #86868 Possible access to unintended variable in "client/mysql_install_db.cc" line 1770
Submitted: 29 Jun 2017 10:54 Modified: 29 Jun 2017 15:31
Reporter: Petru-Florin Mihancea Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[29 Jun 2017 10:54] Petru-Florin Mihancea
Description:
While experimenting with a CodeSonar plugin we develop, we noticed a potential issue in file "mysql-server/client/mysql_install_db.cc" line 1770 function main:

if (!success)
    {
      warning << "failed to execute " << mysql_cert_setup.to_str() << " ";
      copy(cert_setup_command_line.begin(), cert_setup_command_line.end(),
      /*1770*/     infix_ostream_iterator<Path>(error, " "));
      warning << endl;
      warning << "SSL functionality may not work";
      warning << endl;
}

Shouldn't warning variable be used instead of the error variable?

Thanks,
Petru Florin Mihancea

How to repeat:
The issue has been detected automatically via source code static analysis.
[29 Jun 2017 15:31] MySQL Verification Team
Hi!

Your code analysis , that you presented in this bug, is completely correct.

Verified.

Thank you.