commit 6fe589b: [Minor] Check contents object type

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jan 9 14:49:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-01-09 14:48:36 +0000
URL: https://github.com/rspamd/rspamd/commit/6fe589b312379fc70cc7ce1ac5539dc624ce367c (HEAD -> master)

[Minor] Check contents object type

---
 lualib/lua_content/pdf.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua
index f29e1e781..741c011bd 100644
--- a/lualib/lua_content/pdf.lua
+++ b/lualib/lua_content/pdf.lua
@@ -386,8 +386,9 @@ local function process_dict(task, pdf, obj, dict)
     lua_util.debugm(N, task, 'process stream dictionary for object %s:%s -> %s',
         obj.major, obj.minor, obj.type)
     local contents = dict.Contents
-    if contents then
-      if type(contents) == 'table' and contents[1] == '%REF%' then
+    if contents and type(contents) == 'table' then
+      if contents[1] == '%REF%' then
+        -- Single reference
         contents = {contents}
       end
       obj.contents = {}


More information about the Commits mailing list