Bug #108506 Check return error from fil_space_acquire()
Submitted: 15 Sep 2022 23:58 Modified: 16 Sep 2022 5:04
Reporter: Li Zhong Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any

[15 Sep 2022 23:58] 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/storage/innobase/row/row0i..., fil_space_acquire() could return nullptr. So when it is used in FSP_FLAGS_HAS_SDI(space->flags), it's possible to cause null pointer dereference. 

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

Suggested fix:
Check space against nullptr.
[16 Sep 2022 5:04] MySQL Verification Team
Hello Li Zhong,

Thank you for the report and feedback.