Skip to content

Commit

Permalink
- Fix correctly MDEV-7498. The problem was not in AllocateValue but in
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
Buggynours committed Jan 24, 2015
1 parent 2cd36ad commit dbf690b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions storage/connect/tabjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -548,6 +541,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)

} // endfor i, p

MulVal = AllocateValue(g, Value);
Parsed = true;
return false;
} // end of ParseJpath
Expand Down
2 changes: 1 addition & 1 deletion storage/connect/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dbf690b

Please sign in to comment.