From: Marek Vavrusa Date: Mon, 13 Jun 2016 16:53:11 +0000 (-0700) Subject: daemon/engine: fixed json pack for str-encoded int X-Git-Tag: v1.1.0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9206db36e53b577148a1ef2b7eb6708b51b226d;p=thirdparty%2Fknot-resolver.git daemon/engine: fixed json pack for str-encoded int string encoded integers are treated as possible numbers, so a more strict typecheck is needed --- diff --git a/daemon/engine.c b/daemon/engine.c index 3a6251cd0..3ab9bbaa5 100644 --- a/daemon/engine.c +++ b/daemon/engine.c @@ -291,7 +291,7 @@ static JsonNode *l_pack_elem(lua_State *L, int top) while(lua_next(L, top) != 0) { bool is_array = false; if (!node) { - is_array = lua_isnumber(L, top + 1); + is_array = (lua_type(L, top + 1) == LUA_TNUMBER); node = is_array ? json_mkarray() : json_mkobject(); if (!node) { return NULL;