You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +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 char* rawJS = js.str();
|
||||
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,
|
||||
(uchar*)buf + strLen)) >= 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user