Erroneous decoding of binary strings encoded in JSON
Submitted by Gyorgy Rethy
Link to original bug (#509867)
Description
Created attachment 266101 example code
When the JSON string, representing a TTCN-3 binary string (tried with hexstring only), contains other characters than hexadecimal digits, these are "decoded" and inserted into the TTCN-3 value as extra digits. See attached example.
The digits inserted for the incorrect characters also depend if the decoding function has been called to decode another value(s) before.
Error code 2 is returned.
Proposed solution:
- ignore any space (char(U20)), Horizontal tab (char(U9)), Line feed (char(UA)) and Carriage return (char(UD)) characters at decoding (this behaviour is proposed in the draft of the standard)
- any other illegal character should cause a decoding error, i.e. it should cause error code 2, the out parameter should be returned unchanged (unbound if it was unbound before), and the whole input JSON value should be returned unchanged in the inout parameter.
Attachment 266101, "example code":
JSON_examples.ttcn