struct/buf.c (buf_getmem*): Add an explicit `BENSURE'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 11 Oct 2019 22:15:42 +0000 (23:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 19 Oct 2019 13:41:41 +0000 (14:41 +0100)
commitf868c4327d366a7e142e27ffbaa383d75aef6c1b
tree68267a6ee03881df46fd1f858f31eb6e2e88f800
parent5e80901ea39f40c1763ee64dae80fb0a89210db3
struct/buf.c (buf_getmem*): Add an explicit `BENSURE'.

Otherwise we fail when processing a 64-bit length on a 32-bit platform:
an overlong 64-bit length gets truncated to a possibly-acceptable 32-bit
length in the implicit conversion to `size_t' in the call to `buf_get'.
Using `BENSURE' directly ensures that the comparison gets done with the
correct integer type.
struct/buf.c