summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Ahern <william+netbsd@25tandclement.com>2016-08-12 20:38:44 +0000
committerWilliam Ahern <william+netbsd@25tandclement.com>2016-08-12 20:38:44 +0000
commit40951862e12fe8d9c2fd0ffd4f16e9fe4d951f33 (patch)
treed3c164650b7ad3b31ef52582b7f52c172f8c44b3
parenteceb64a5ee4980a652cddf226f4e7a0d18080a3b (diff)
downloadluaossl-40951862e12fe8d9c2fd0ffd4f16e9fe4d951f33.tar.gz
luaossl-40951862e12fe8d9c2fd0ffd4f16e9fe4d951f33.tar.bz2
luaossl-40951862e12fe8d9c2fd0ffd4f16e9fe4d951f33.zip
in bignum string conversion, don't pass char or signed char to isdigit or isxdigit
-rw-r--r--src/openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 22c6e85..d8eebb5 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -1861,13 +1861,13 @@ static BIGNUM *(checkbig)(lua_State *L, int index, _Bool *lvalue) {
1861 if (hex) { 1861 if (hex) {
1862 luaL_argcheck(L, len > 2+(size_t)neg, index, "invalid hex string"); 1862 luaL_argcheck(L, len > 2+(size_t)neg, index, "invalid hex string");
1863 for (i = 2+neg; i < len; i++) { 1863 for (i = 2+neg; i < len; i++) {
1864 if (!isxdigit(str[i])) 1864 if (!isxdigit((unsigned char)str[i]))
1865 luaL_argerror(L, 1, "invalid hex string"); 1865 luaL_argerror(L, 1, "invalid hex string");
1866 } 1866 }
1867 } else { 1867 } else {
1868 luaL_argcheck(L, len > neg, index, "invalid decimal string"); 1868 luaL_argcheck(L, len > neg, index, "invalid decimal string");
1869 for (i = neg; i < len; i++) { 1869 for (i = neg; i < len; i++) {
1870 if (!isdigit(str[i])) 1870 if (!isdigit((unsigned char)str[i]))
1871 luaL_argerror(L, 1, "invalid decimal string"); 1871 luaL_argerror(L, 1, "invalid decimal string");
1872 } 1872 }
1873 } 1873 }