mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-36344: UBSAN Lifo_buffer::have_space_for change
Adjust Lifo_buffer::have_space_for to not lead itself to UBSAN overflows.
This commit is contained in:
committed by
Daniel Black
parent
087a948e2e
commit
3c684f1e69
@@ -174,7 +174,7 @@ public:
|
||||
uchar *end_of_space() override { return pos; }
|
||||
bool have_space_for(size_t bytes) override
|
||||
{
|
||||
return (pos + bytes < end);
|
||||
return (size_t) (end - pos) > bytes;
|
||||
}
|
||||
|
||||
void write() override
|
||||
|
||||
Reference in New Issue
Block a user