[getdns-users] bindata string encoding?

Melinda Shore melinda.shore at nomountain.net
Thu Jul 9 19:05:07 UTC 2015

On 7/9/15 10:42 AM, Robert Edmonds wrote:
> I think this is backwards: if you have a byte sequence and an explicit
> length, this allows for embedded NUL bytes, and you should use the
> explicit length rather than assuming the byte sequence is a C-style
> string and truncating it at the first NUL byte (or, worse, performing an
> out-of-bounds read if it turned out this assumption was incorrect and
> the sequence didn't contain a NUL byte).

I'm kind of "meh" on that - I'm not sure that it's reasonable to
assume the possible presence of a 0 byte in the middle of something
that's agreed to be a C-format string.  There are definitely places
we're punting the bounds-checking to the Python libraries and that
may not be reasonable.


Melinda Shore
No Mountain Software
melinda.shore at nomountain.net

"Software longa, hardware brevis."

More information about the Users mailing list