diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-06 20:25:35 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-06 20:25:35 +0100 |
commit | bbff6aea5990f02c1d70adb553b9d2bf3fbcb26a (patch) | |
tree | ae28427e37d3697a5cbac164875e59555d6f6de9 /lualib/lua_content | |
parent | 12ef6d2fe30b2e460b145046c92b16dac3b8973d (diff) | |
download | rspamd-bbff6aea5990f02c1d70adb553b9d2bf3fbcb26a.tar.gz rspamd-bbff6aea5990f02c1d70adb553b9d2bf3fbcb26a.zip |
[Minor] Pdf: Add more sanity checks
Diffstat (limited to 'lualib/lua_content')
-rw-r--r-- | lualib/lua_content/pdf.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index 8a1e16ad0..7b940ff0d 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -460,7 +460,12 @@ local function parse_object_grammar(obj, task, pdf) if ret then if obj.stream then - obj.dict = obj_or_err + if type(obj_or_err) == 'table' then + obj.dict = obj_or_err + else + obj.dict = {} + end + lua_util.debugm(N, task, 'stream object %s:%s is parsed to: %s', obj.major, obj.minor, obj_or_err) else |