From 3bdebe6d24c2e3526a4c5f5e22c39c902ad7eb62 Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 17 Nov 2020 15:35:54 +0800 Subject: [PATCH] fix: add missing addpair error check --- dkjson.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/dkjson.lua b/dkjson.lua index b63d5ac..6744c06 100644 --- a/dkjson.lua +++ b/dkjson.lua @@ -322,6 +322,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s if v then used[k] = true buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state) + if not buflen then return nil, msg end prev = true -- add a seperator before the next element end end -- 2.45.2