ion-c icon indicating copy to clipboard operation
ion-c copied to clipboard

BLOB/CLOB's of size zero fail during read process

Open ezabes opened this issue 1 year ago • 1 comments

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.

ezabes avatar Sep 21 '23 22:09 ezabes

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.

nirosys avatar Sep 25 '23 20:09 nirosys

Thank you again ezabes for reporting this issue! #348 has been merged to address the problem.

nirosys avatar Aug 05 '24 20:08 nirosys