mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
MDEV-38463: subtraction of unsigned offset ... overflowed
row_log_table_apply_ops(), row_log_apply_ops(): When switching buffers, do not subtract addresses of unrelated buffers, but simply set mrec_end relative to mrec. This makes the code more readable and will avoid a runtime error from clang -fsanitize=undefined depending on what kind of addresses are being returned by row_log_block_allocate().
This commit is contained in:
parent
c7313daf8c
commit
37dce6b547
1 changed files with 6 additions and 6 deletions
|
|
@ -2806,10 +2806,10 @@ process_next_block:
|
|||
ut_ad(0);
|
||||
goto unexpected_eof;
|
||||
} else {
|
||||
memcpy(index->online_log->head.buf, mrec,
|
||||
ulint(mrec_end - mrec));
|
||||
mrec_end -= ulint(mrec - index->online_log->head.buf);
|
||||
const size_t s = size_t(mrec_end - mrec);
|
||||
memcpy(index->online_log->head.buf, mrec, s);
|
||||
mrec = index->online_log->head.buf;
|
||||
mrec_end = mrec + s;
|
||||
goto process_next_block;
|
||||
}
|
||||
}
|
||||
|
|
@ -3698,10 +3698,10 @@ process_next_block:
|
|||
ut_ad(0);
|
||||
goto unexpected_eof;
|
||||
} else {
|
||||
memcpy(index->online_log->head.buf, mrec,
|
||||
ulint(mrec_end - mrec));
|
||||
mrec_end -= ulint(mrec - index->online_log->head.buf);
|
||||
const size_t s = size_t(mrec_end - mrec);
|
||||
memcpy(index->online_log->head.buf, mrec, s);
|
||||
mrec = index->online_log->head.buf;
|
||||
mrec_end = mrec + s;
|
||||
goto process_next_block;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue