mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-22387: Do not violate __attribute__((nonnull))
This follows up commit commit94a520ddbe
and commit7c5519c12d
. After these changes, the default test suites on a cmake -DWITH_UBSAN=ON build no longer fail due to passing null pointers as parameters that are declared to never be null, but plenty of other runtime errors remain.
This commit is contained in:
@ -4548,7 +4548,8 @@ extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen)
|
||||
if (!mysql_mutex_trylock(&thd->LOCK_thd_data))
|
||||
{
|
||||
len= MY_MIN(buflen - 1, thd->query_length());
|
||||
memcpy(buf, thd->query(), len);
|
||||
if (len)
|
||||
memcpy(buf, thd->query(), len);
|
||||
mysql_mutex_unlock(&thd->LOCK_thd_data);
|
||||
}
|
||||
buf[len]= '\0';
|
||||
|
Reference in New Issue
Block a user