Commit dbf690b5 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix correctly MDEV-7498. The problem was not in AllocateValue but in

  the constructor of TYPVAL<PSZ> The new strg was widely uninitialised
  just by setting a terminated null char. Now the whole string is zero'ed.
  In Tabjson JSONCOL::ParseJpath, the original code was restored. 
modified:
  storage/connect/tabjson.cpp
  storage/connect/value.cpp
parent 2cd36ad7
......@@ -508,13 +508,6 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
if (Parsed)
return false; // Already done
if (InitValue(g))
return true;
else
MulVal = Value;
Value = NULL;
if (InitValue(g))
return true;
else if (!Jpath)
......@@ -548,6 +541,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
} // endfor i, p
MulVal = AllocateValue(g, Value);
Parsed = true;
return false;
} // end of ParseJpath
......
......@@ -1224,7 +1224,7 @@ TYPVAL<PSZ>::TYPVAL(PGLOBAL g, PSZ s, int n, int c)
if (!s) {
if (g) {
if ((Strp = (char *)PlgDBSubAlloc(g, NULL, Len + 1)))
Strp[Len] = '\0';
memset(Strp, 0, Len + 1);
else
Len = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment