]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Handle rspamd_text userdata in sanitize_pdf_text
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 24 Nov 2025 15:01:58 +0000 (15:01 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 24 Nov 2025 15:01:58 +0000 (15:01 +0000)
lualib/lua_content/pdf.lua

index de72952d58da8ad6c539dbde4dc8646863dfa3e9..2625f79d02318936a2b11bd703a1cdfc36cef659 100644 (file)
@@ -404,7 +404,7 @@ local function gen_text_grammar()
           local garbage_limit = 0
           local clen = #conv
           for i = 1, clen do
-            local b = string.byte(conv, i)
+            local b = conv:byte(i)
             if b < 32 and b ~= 9 and b ~= 10 and b ~= 13 then
               garbage_limit = garbage_limit + 1
             end