aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@25thandClement.com> 2015-12-17 15:57:51 +0800
committerLibravatarLibravatar William Ahern <william@25thandClement.com> 2015-12-17 15:57:51 +0800
commit0420baf6eb0106b146dd33d016cf8521cf017bed (patch)
treebf9f3a8db13bd80658634cb949a88c068b470f1e
parente49fb93e3cd1d42b41ddca916bdb327240ebca31 (diff)
downloadluaossl-0420baf6eb0106b146dd33d016cf8521cf017bed.tar.gz
luaossl-0420baf6eb0106b146dd33d016cf8521cf017bed.tar.bz2
luaossl-0420baf6eb0106b146dd33d016cf8521cf017bed.zip
fixed char buffer signedness issue
-rw-r--r--src/openssl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 2bb5d70..cb7470a 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -1755,10 +1755,14 @@ static BN_CTX *getctx(lua_State *L) {
static int bn_tobin(lua_State *L) {
BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS);
- size_t len = BN_num_bytes(bn);
- unsigned char* dst = lua_newuserdata(L, len);
+ size_t len;
+ void *dst;
+
+ len = BN_num_bytes(bn);
+ dst = lua_newuserdata(L, len);
BN_bn2bin(bn, dst);
lua_pushlstring(L, dst, len);
+
return 1;
} /* bn_tobin() */