Bug #108510 Return value of rotate() not get checked
Submitted: 16 Sep 2022 0:31 Modified: 16 Sep 2022 5:36
Reporter: Li Zhong Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any

[16 Sep 2022 0:31] Li Zhong
Hi, I'm researcher on static analysis and we find a potential null pointer dereference bug in MySQL-server-8.0.21 code:

In https://github.com/mysql/mysql-server/blob/mysql-cluster-8.0.21/sql/sys_vars.cc#L3840, rotate() could return error but now it's unchecked.

How to repeat:
We find this by our static analysis tool. The analysis result is checked manually.

Suggested fix:
if (mysql_bin_log.rotate(true, &check_purge))
  return true;
[16 Sep 2022 5:36] MySQL Verification Team
Hello Li Zhong,

Thank you for the report and feedback.