1
0
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:
Oleg Smirnov
2026-06-15 13:28:20 +10:00
committed by Daniel Black
parent 087a948e2e
commit 3c684f1e69

View File

@@ -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