ion-c
ion-c copied to clipboard
BLOB/CLOB's of size zero fail during read process
When the ion reader is trying to read a BLOB/CLOB/byte array of length zero, buf_max is assigned to equal 0 and enters an endless loop upon testing an assertion.
ASSERT(buf_max)
This line appears at line 1747 in ion_reader.c in function: iERR _ion_reader_read_lob_bytes_helper Line also appears at line 1950 in ion_reader_text.c in function: iERR _ion_reader_text_read_lob_bytes
Note the function: iERR ion_reader_read_lob_bytes tests buf_max before calling function _ion_reader_read_lob_bytes_helper
if (buf_max < 0) FAILWITH(IERR_INVALID_ARG);
The line in ion_reader_binary.c appears as:
ASSERT(buf_max >= 0);
Changing the ASSERTS in ion_reader.c and ion_reader_text.c to match the ion_reader_binary appears to resolve the issue.
Oh my, thank you again ezabes. :) We'll hopefully get to look at this in the next couple days. Thank you again, we really appreciate your issue submissions.
Thank you again ezabes for reporting this issue! #348 has been merged to address the problem.