diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-03-05 11:49:20 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-03-05 11:49:32 +0000 |
commit | d9190d842306a1b3b10bd144b7a0b6761e998d11 (patch) | |
tree | 8ca65473af01c2c0d3acafb1a8e3ba8bcecb3e29 /lualib/lua_content/pdf.lua | |
parent | 0eccf0331b1949e9642347cb38868ce609f7eaff (diff) | |
download | rspamd-d9190d842306a1b3b10bd144b7a0b6761e998d11.tar.gz rspamd-d9190d842306a1b3b10bd144b7a0b6761e998d11.zip |
[Minor] Add some sanity checks
Diffstat (limited to 'lualib/lua_content/pdf.lua')
-rw-r--r-- | lualib/lua_content/pdf.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index 9c09618c0..c69c9e3d2 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -639,7 +639,7 @@ process_dict = function(task, pdf, obj, dict) for _,c in ipairs(contents) do local cobj = maybe_dereference_object(c, pdf, task) - if cobj then + if cobj and type(cobj) == 'table' then obj.contents[#obj.contents + 1] = cobj cobj.parent = obj cobj.type = 'content' @@ -766,7 +766,7 @@ local function pdf_compound_object_unpack(_, uncompressed, pdf, task, first) span_len = (elts[i + 1][2] + first) - offset end - if span_len > 0 then + if span_len > 0 and offset + span_len < #uncompressed then local obj = { major = obj_number, minor = 0, -- Implicit |