diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-13 17:05:07 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-13 17:05:07 +0000 |
commit | b20521fd4e5a57b1b27f021f77f0e0dfbf8c9731 (patch) | |
tree | c6f4fb482ab177d73150ed25fe4b74fd8dd7226c /lualib/lua_content | |
parent | 1f10961d98ce1b0f8b3bcb1f4431eacbe5a01b5a (diff) | |
download | rspamd-b20521fd4e5a57b1b27f021f77f0e0dfbf8c9731.tar.gz rspamd-b20521fd4e5a57b1b27f021f77f0e0dfbf8c9731.zip |
[Minor] Lua_content: Fix hang
Diffstat (limited to 'lualib/lua_content')
-rw-r--r-- | lualib/lua_content/pdf.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index 741c011bd..516eb8be2 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -54,7 +54,7 @@ local pdf_patterns = { }, start_object = { patterns = { - [=[[\r\n]\s*\d+ \d+ obj[\r\n]]=] + [=[[\r\n\0]\s*\d+ \d+ obj[\r\n]]=] } }, end_object = { @@ -517,7 +517,10 @@ local function postprocess_pdf_objects(task, input, pdf) obj_count = obj_count + 1 start_pos = start_pos + 1 end_pos = end_pos + 1 - elseif start_pos > end_pos then + elseif first > last then + end_pos = end_pos + 1 + else + start_pos = start_pos + 1 end_pos = end_pos + 1 end end |