Mercurial > prosody-hg
diff .lua-format @ 14179:25beb66fab38 13.0
util.crypto: Use post-Lua 5.1 buffer API
Tha Lua 5.1 buffer API was frustrating to work with. luaL_prepbuffer() only
allocates LUAL_BUFFERSIZE - there is no way to request a specific size.
LUAL_BUFFERSIZE is set to BUFSIZ by default, which is generally 8192 bytes on
Linux, however it may vary between platforms.
The variation means this buffer could potentially overflow (small BUFSIZ with
large signature).
The Lua 5.2+ buffer API enables requesting a specific buffer size, so that's
what we do now.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 25 May 2026 15:11:47 +0100 |
| parents | 81ae5e12550f |
| children |
