]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CID 1400023: Check return code of fr_pair_value_from_str
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 26 May 2017 14:06:19 +0000 (10:06 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 26 May 2017 19:04:19 +0000 (15:04 -0400)
src/modules/rlm_lua/lua.c

index 05a2a1280c70e85da88cb24504794aaa31886413..9bc4f8544fc0c186ae1854e53a23de55671e39d1 100644 (file)
@@ -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;