1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-31881 ASAN: unknown-crash in check_ulonglong (sql/sql_analyse.cc) on SELECT ... FROM ... PROCEDURE ANALYSE()

Fixing a wrong condition which made the code read 1 byte behind the buffer.
This commit is contained in:
Alexander Barkov
2024-11-21 10:01:48 +04:00
parent 39f1f30f68
commit 95df7ea33a
3 changed files with 20 additions and 1 deletions

View File

@ -1204,7 +1204,7 @@ uint check_ulonglong(const char *str, uint length)
const char *long_str = "2147483647", *ulonglong_str = "18446744073709551615";
const uint long_len = 10, ulonglong_len = 20;
while (*str == '0' && length)
while (length && *str == '0')
{
str++; length--;
}