aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util-src/crypto.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/util-src/crypto.c b/util-src/crypto.c
index 0f4edb51..c5ecf9ab 100644
--- a/util-src/crypto.c
+++ b/util-src/crypto.c
@@ -485,12 +485,7 @@ static int Lbuild_ecdsa_signature(lua_State *L) {
luaL_buffinit(L, &sigbuf);
- // COMPAT w/ Lua 5.1
- #if LUAL_BUFFERSIZE < 128
- #error Configured LUAL_BUFFERSIZE is too small for this operation
- #endif
-
- unsigned char *buffer = (unsigned char*)luaL_prepbuffer(&sigbuf);
+ unsigned char *buffer = (unsigned char*)luaL_prepbuffsize(&sigbuf, rlen+slen+32);
int len = i2d_ECDSA_SIG(sig, &buffer);
luaL_addsize(&sigbuf, len);
luaL_pushresult(&sigbuf);