[MDEV-3766] LP:956079 - Potential NULL pointer dereference in pagecache_fwrite Created: 2012-03-15 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Inside pagecache_fwrite() , in ma_pagecache.c, if my_pwrite() fails, the error handling callback function is called via function pointer. the code in question is if (my_pwrite(filedesc->file, buffer, pagecache->block_size, the problem is that *filedesc->write_fail can be NULL, which means failing my_pwrite() will cause a crash by dereferencing NULL pointer. To reproduce, 1. add line 2. Compile with DBUG, run 3. Observe a crash . Here is for example what I get in 5.1 0028B9C3 mysqld.exe!my_sigabrt_handler()[mysqld.cc:2188] 0063CC23 mysqld.exe!_ma_once_end_block_record()[ma_blockrec.c:451] |
| Comments |
| Comment by Vladislav Vaintroub [ 2012-03-15 ] |
|
Re: Potential NULL pointer dereference in pagecache_fwrite |
| Comment by Rasmus Johansson (Inactive) [ 2012-05-03 ] |
|
Launchpad bug id: 956079 |