mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix memory error when a plain string argument is parsed.
Parsing memory, not added in CalcLen, is added in CheckMemory. Adding also the file length. modified: storage/connect/jsonudf.cpp
This commit is contained in:
@@ -1426,10 +1426,11 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
|
||||
char *p = args->args[0];
|
||||
|
||||
// Is this a file name?
|
||||
if (strchr("[{ \t\r\n", *p) || !(len = GetFileLength(p)))
|
||||
len = args->lengths[0];
|
||||
if (!strchr("[{ \t\r\n", *p) && (len = GetFileLength(p)))
|
||||
ml += len * (M + 1);
|
||||
else
|
||||
ml += args->lengths[0] * M;
|
||||
|
||||
ml += len * M; // Was not done in CalcLen
|
||||
} // endif b
|
||||
|
||||
if (ml > g->Sarea_Size) {
|
||||
|
Reference in New Issue
Block a user