It was fixed in 2018, but no release was made at the time
https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aa...
Looks like they ported zlib to Pascal in 1998 and left it pretty much unchanged:
https://gitlab.com/freepascal.org/fpc/source/-/blob/main/pac...