blob: 24753dc2b5351e322c072c4b370b7700d35cac70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-ah,v 1.19 2010/10/28 20:11:18 bouyer Exp $
Fix "Unknown error code ERROR" on some PDF. Will be in 0.96.4:
http://git.clamav.net/gitweb?p=clamav-devel.git;a=commitdiff;h=e142504b07d7f81435f6ac99ec1eedf6c08f2188
Fix "LibClamAV Error: cli_pdf: mmap() failed (2)" on some PDF.
Will be in 0.96.4:
http://git.clamav.net/gitweb?p=clamav-devel.git;a=commitdiff;h=8f6bf9fc080aa54badcd7608f253821d5a8b1786
diff --git a/libclamav/pdf.c b/libclamav/pdf.c
index cd4d25a..e242135 100644 (file)
--- libclamav/pdf.c.orig 2010-09-20 15:24:46.000000000 +0200
+++ libclamav/pdf.c 2010-10-23 16:46:49.000000000 +0200
@@ -1024,7 +1024,7 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
offset += pdfver - start;
/* find trailer and xref, don't fail if not found */
- map_off = map->len - 2048;
+ map_off = (off_t)map->len - 2048;
if (map_off < 0)
map_off = 0;
bytesleft = map->len - map_off;
@@ -1087,7 +1087,7 @@
rc = run_pdf_hooks(&pdf, PDF_PHASE_PRE, -1, -1);
if (rc) {
cli_dbgmsg("cli_pdf: returning %d\n", rc);
- return rc;
+ return rc == CL_BREAK ? CL_CLEAN : rc;
}
/* parse PDF and find obj offsets */
while ((rc = pdf_findobj(&pdf)) > 0) {
|