binread icon indicating copy to clipboard operation
binread copied to clipboard

support count option for NullString/NullWIdeString

Open hiratara opened this issue 1 year ago • 2 comments

Hi,

NullString is useful, but I am concerned when reading malicious files that do not contain '\0'. As with Vec<u8>, support for the count option avoids reading data without limit.

Also, we sometimes store a string in a fixed-length field and fill it with '\0', but even then we want to use NullString to avoid unnecessary reads. For that use cases, please see the test I wrote in this PR.

hiratara avatar Jan 29 '23 02:01 hiratara