From: Arran Cudbard-Bell Date: Fri, 26 May 2017 14:06:19 +0000 (-0400) Subject: CID 1400023: Check return code of fr_pair_value_from_str X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9abcb45455c907e5135d8a704f2107111862575f;p=thirdparty%2Ffreeradius-server.git CID 1400023: Check return code of fr_pair_value_from_str --- diff --git a/src/modules/rlm_lua/lua.c b/src/modules/rlm_lua/lua.c index 05a2a1280c7..9bc4f8544fc 100644 --- a/src/modules/rlm_lua/lua.c +++ b/src/modules/rlm_lua/lua.c @@ -275,10 +275,13 @@ static int rlm_lua_unmarshall(VALUE_PAIR **out, REQUEST *request, lua_State *L, char const *p; p = lua_tostring(L, -1); if (!p) { - RDEBUG("Unmarshalling failed: Lua string was NULL"); + REDEBUG("Unmarshalling failed: Lua string was NULL"); + return -1; + } + if (fr_pair_value_from_str(vp, p, strlen(p)) < 0) { + RPEDEBUG("Unmarshalling failed"); return -1; } - (void) fr_pair_value_from_str(vp, p, strlen(p)); } break;