-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
Description
When using the c extension on an Ion Value Stream that ends prematurely within an Ion Container, but not within a scalar value inside it, loads hangs indefinitely.
For example:
import amazon.ion.simpleion as ion
ion.loads(b'\xe0\x01\x00\xea\xb6') # a 6 octet list is declared, stream ends before value is provided
premature ends within scalars appears to work fine:
ion.loads(b'\xe0\x01\x00\xea!') # a top-level Ion Int is declared, stream ends before value is provided
ion.loads(b'\xe0\x01\x00\xea\xb2!') # value within a 6 octet list ends prematurely itself.
It looks like there needs to be a check in ioncmodule.c for this. I suspect the root of the problem there is that ion-c returns tid_EOF for both EOF and end of each container. So an EOF is expected within a container.