# HG changeset patch # User Kim Alvefur # Date 1572696594 -3600 # Node ID 2283381200096ed135163189f5433f29cfe1521e # Parent 78bda7932f170896efdc56ad4837162eac22421f 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. diff -r 78bda7932f17 -r 228338120009 util-src/encodings.c --- 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 */