Closed Helaas closed 1 year ago
Hello,
I'm here to make some trouble again 🙂
We've noticed that an empty string can cause the data-into parser to crash:
dcl-ds params qualified inz; s char(10) inz; a likeds(a_t) inz(*likeds); end-ds; dcl-ds a_t qualified template; o likeds(o_t) dim(99) inz(*likeds); end-ds; dcl-ds o_t qualified template; b char(100) inz; c char(100) inz; end-ds; dcl-s pfrom pointer; //-------------------------------------------------------------------- pFrom = json_parseString ('{ - "s":"Life is a gift", - "a":{ - "o":[ - { - "b":"hello world", - "c":" " - }, - { - "b":"hello world", - "c":" " - }, - { - "b":"hello world", - "c":" " - } - ] - } - }'); // works fine data-into params %data ('':'allowextra=yes allowmissing=yes case=any') %parser(json_DataInto(pFrom)); json_delete(pFrom); pFrom = json_parseString ('{ - "s":"Life is a gift", - "a":{ - "o":[ - { - "b":"hello world", - "c":"" - }, - { - "b":"hello world", - "c":"" - }, - { - "b":"hello world", - "c":"" - } - ] - } - }'); // crash! data-into params %data ('':'allowextra=yes allowmissing=yes case=any') %parser(json_DataInto(pFrom)); json_delete(pFrom); Return;
In summary, for the string where c has a space between the quotes there is no issue. ( "c":" ") However, for "c":"" we run into the issue.
"c":" "
"c":""
Thanx !! I can confirm it - we can reproduce the issue here. Fix is on its way !!
Hello,
I'm here to make some trouble again 🙂
We've noticed that an empty string can cause the data-into parser to crash:
In summary, for the string where c has a space between the quotes there is no issue. (
"c":" "
) However, for"c":""
we run into the issue.