Bug #108507 Return value of my_rand_buffer() not get checked
Submitted: 16 Sep 2022 0:07 Modified: 16 Sep 2022 5:21
Reporter: Li Zhong Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any

[16 Sep 2022 0:07] Li Zhong
Description:
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/os/os0enc..., my_rand_buffer() could return error but now the error is ignored.

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

Suggested fix:
Maybe add check:

int err = (my_rand_buffer(value, KEY_LEN));
ut_ad(!err);
[16 Sep 2022 5:21] MySQL Verification Team
Hello Li Zhong,

Thank you for the report and feedback.

regards,
Umesh