mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 15:55:53 +02:00
Fixing wrong memory read problem detected by Valgrind in "xml" test.
The source of the problem was in my_vsnprintf() implementation.
This commit is contained in:
parent
1f12c44b91
commit
ad8e43155b
1 changed files with 1 additions and 2 deletions
|
|
@ -95,8 +95,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
|
|||
reg2 char *par = va_arg(ap, char *);
|
||||
uint plen,left_len = (uint)(end-to)+1;
|
||||
if (!par) par = (char*)"(null)";
|
||||
plen = (uint) strlen(par);
|
||||
set_if_smaller(plen,width);
|
||||
plen= (uint) strnlen(par, width);
|
||||
if (left_len <= plen)
|
||||
plen = left_len - 1;
|
||||
to=strnmov(to,par,plen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue