zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.62k stars 2.35k forks source link

strnlen implementation does not match spec #4531

Open mark64 opened 1 year ago

mark64 commented 1 year ago

The compat.hpp implementation returns i + 1 when it encounters a null byte: https://github.com/zeromq/libzmq/blob/94bf58e43c2c4f7acbb5cdb7a18fdc7f28f72182/src/compat.hpp#L68

However, the man page says it should exclude the null byte: https://man7.org/linux/man-pages/man3/strnlen.3.html

I believe this should change, but want to check