binread
binread copied to clipboard
support count option for NullString/NullWIdeString
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.