aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-06-05 20:16:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-06-05 20:16:15 +0100
commit1a5d3a27d7fffd575816d6efa6965c5702bf4171 (patch)
tree706066884e9db16248c8e2725428bae4b2180fc2 /lualib
parenta0abf274881281f3c7e7d604ab94bf3421b973d5 (diff)
downloadrspamd-1a5d3a27d7fffd575816d6efa6965c5702bf4171.tar.gz
rspamd-1a5d3a27d7fffd575816d6efa6965c5702bf4171.zip
[Minor] Pdf: Add some sanity check
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_content/pdf.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua
index 5e1fa9061..ed88a24bd 100644
--- a/lualib/lua_content/pdf.lua
+++ b/lualib/lua_content/pdf.lua
@@ -426,7 +426,7 @@ local function maybe_extract_object_stream(obj, pdf, task)
return nil
end
local dict = obj.dict
- if dict.Length then
+ if dict.Length and type(obj.stream) == 'table' then
local len = math.min(obj.stream.len,
tonumber(maybe_dereference_object(dict.Length, pdf, task)) or 0)
local real_stream = obj.stream.data:span(1, len)