# HG changeset patch # User Matthew Wild # Date 1779717075 -3600 # Node ID af87d31dcae40ae38e5ae4adac8fd9e0d44ce5d4 # Parent 67b68147ed1dea9622f26b1f01e75833f9560d54 util.crypto: Ensure signing parameter is a string lua_tostring() returns NULL if the specified value is missing or can't become a string. luaL_checkstring() will raise an error. We prefer the latter behaviour, otherwise we end up passing NULL to OpenSSL. diff -r 67b68147ed1d -r af87d31dcae4 util-src/crypto.c --- a/util-src/crypto.c Mon May 25 14:44:20 2026 +0100 +++ b/util-src/crypto.c Mon May 25 14:51:15 2026 +0100 @@ -132,7 +132,7 @@ luaL_Buffer sigbuf; size_t msg_len; - const unsigned char* msg = (unsigned char*)lua_tolstring(L, 2, &msg_len); + const unsigned char* msg = (unsigned char*)luaL_checklstring(L, 2, &msg_len); size_t sig_len; unsigned char *sig = NULL;