Skip to content

Commit 5676ecf

Browse files
committed
MDEV-38126: Fix -DWITH_UBSAN=ON
logger_init_mutexes(void): Define the function as taking no arguments, to avoid function pointer type mismatch. my_b_flush_io_cache(): runtime error: addition of unsigned offset ... overflowed. Cast to a signed offset.
1 parent f102d1b commit 5676ecf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mysys/file_logger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ int logger_set_rotations(LOGGER_HANDLE *log, unsigned int new_rotations)
311311
return 0;
312312
}
313313

314-
void logger_init_mutexes()
314+
void logger_init_mutexes(void)
315315
{
316316
#ifdef HAVE_PSI_INTERFACE
317317
if (unlikely(PSI_server))

mysys/mf_iocache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,8 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
17901790

17911791
if ((length=(size_t) (info->write_pos - info->write_buffer)))
17921792
{
1793-
my_off_t eof= info->end_of_file + info->write_pos - info->append_read_pos;
1793+
my_off_t eof= info->end_of_file +
1794+
(ptrdiff_t)(info->write_pos - info->append_read_pos);
17941795
if (append_cache)
17951796
{
17961797
if (tmp_file_track(info, eof) ||

0 commit comments

Comments
 (0)