Closed skaes closed 1 week ago
This all seems very reasonable.
Here's my proposal.
Sound good?
Note that FFI 1.14.1 was released, and it undid that change: https://github.com/ffi/ffi/issues/857 So existing releases of ffi-rzmq + FFI 1.14.1 or FFI < 1.14.0 should work fine.
Still, I think it's a good idea to use put_bytes()
here as it's more explicit that null termination is not wanted.
The semantics of write_string was changed in ffi 1.14.0 to add a NULL byte at the end of the target buffer. This causes buffer overflows in all programs that relied on the old semantics.
This patch fixes the problem by using the underlying b.put_bytes method.