You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
chore(memory): fix dynamic stack buffer overflow
This commit is contained in:
committed by
Leonid Fedorov
parent
b65a5a1ef9
commit
10c2ce0dd5
@@ -31,7 +31,7 @@ bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullSt
|
|||||||
const int jsLen = js.length();
|
const int jsLen = js.length();
|
||||||
const char* rawJS = js.str();
|
const char* rawJS = js.str();
|
||||||
int strLen = jsLen * 12 * jsCS->mbmaxlen / jsCS->mbminlen;
|
int strLen = jsLen * 12 * jsCS->mbmaxlen / jsCS->mbminlen;
|
||||||
char* buf = (char*)alloca(strLen);
|
char* buf = (char*)alloca(strLen + 1);
|
||||||
if ((strLen = json_escape(retCS, (const uchar*)rawJS, (const uchar*)rawJS + jsLen, jsCS, (uchar*)buf,
|
if ((strLen = json_escape(retCS, (const uchar*)rawJS, (const uchar*)rawJS + jsLen, jsCS, (uchar*)buf,
|
||||||
(uchar*)buf + strLen)) >= 0)
|
(uchar*)buf + strLen)) >= 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user