Skip to content

Commit 74687dc

Browse files
committed
Bug#14838882: INIT_IO_CACHE() HAS SUSPICIOUS MEMSET()
The problem was that init_io_cache() contained a memset() that with SAFE_MUTEX was used to clear a mutex - IO_CACHE::append_buffer_lock. However the size of memory cleared was the size of the IO_CACHE pointer rather than the size of the IO_CACHE::append_buffer_lock mutex. This patch fixes the problem by clearing the appropriate number of bytes.
1 parent 7944794 commit 74687dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mysys/mf_iocache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
259259
else
260260
{
261261
/* Clear mutex so that safe_mutex will notice that it's not initialized */
262-
memset(&info->append_buffer_lock, 0, sizeof(info));
262+
memset(&info->append_buffer_lock, 0, sizeof(info->append_buffer_lock));
263263
}
264264
#endif
265265

0 commit comments

Comments
 (0)