Software /
code /
prosody
Diff
util-src/encodings.c @ 10371:228338120009
util.encodings: Don't ignore non-strings passed to stringprep functions
If you manage to pass a table or something weird to these, you deserve
to know.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Nov 2019 13:09:54 +0100 |
parent | 10359:4ef785f45aa2 |
child | 10478:5e9a1a75f8a7 |
line wrap: on
line diff
--- a/util-src/encodings.c Fri Nov 01 23:18:29 2019 +0100 +++ b/util-src/encodings.c Sat Nov 02 13:09:54 2019 +0100 @@ -283,12 +283,7 @@ UErrorCode err = U_ZERO_ERROR; - if(!lua_isstring(L, 1)) { - lua_pushnil(L); - return 1; - } - - input = lua_tolstring(L, 1, &input_len); + input = luaL_checklstring(L, 1, &input_len); if(input_len >= 1024) { lua_pushnil(L); @@ -408,11 +403,6 @@ int ret; Stringprep_profile_flags flags = 0; - if(!lua_isstring(L, 1)) { - lua_pushnil(L); - return 1; - } - s = check_utf8(L, 1, &len); /* strict */