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

Binary Reader Type Descriptor Validation

Open jonwilsdon opened this issue 6 years ago • 0 comments

There is some cleanup work to be done with how ion-java validates binary Ion type descriptors that came out of amzn/ion-tests#57 when testing the ion-tests/iontestdata/bad/typecodes/*.10n files:

  • type_1_length_14.10n (0x1E) fails with Exception in thread "main" com.amazon.ion.IonException: unrecognized value type encountered: 15 at position 7instead ofException in thread "main" com.amazon.ion.IonException: invalid length nibble in boolean value: 14 at position 5`
  • type_6_length_0.10n (0x60) passes and produces null.timestamp instead of failing
  • type_6_length_1.10n (0x61) fails with Exception in thread "main" com.amazon.ion.IonException: unexpected EOF in value at position 6 instead of Exception in thread "main" com.amazon.ion.IonException: invalid length nibble in timestamp value: 1 at position 5
  • type_14_length_[1,2].10n (0xE_) fails with Exception in thread "main" com.amazon.ion.IonException: unexpected EOF in value at position 6 instead of Exception in thread "main" com.amazon.ion.IonException: invalid length nibble in annotation value: [1,2] at position 5
  • type_14_length_15.10n (0xEF) fails with Exception in thread "main" com.amazon.ion.IonException: invalid binary image at position 5 instead of Exception in thread "main" com.amazon.ion.IonException: invalid length nibble in annotation value: 15 at position 5

jonwilsdon avatar Jan 07 '20 00:01 jonwilsdon