intrig / xenon

The Intrig Message Decoder
MIT License
1 stars 6 forks source link

<cstr> guard #3

Closed intrig closed 5 years ago

intrig commented 8 years ago

The cstr element blindly reads until it finds a '\0'. It should be limited by the remaining bits in the record and by the max attribute.

Also, it does not work for non-byte aligned cstr. This should either be fixed or fail gracefully.

DaveCausey commented 8 years ago

Also, it appears to add the null terminator to the string itself, resulting in null characters in the decoder output. The terminating null should not be included in the length of the string.

intrig commented 8 years ago

Ok, fixed the null char problem. Since this is an untested feature I feel no need to verify my fixes, but I'm pretty confident.