From 51d1895aef6d18da0c16a3dabd03c80e6ed6c90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edvin?= Date: Tue, 7 Oct 2008 09:02:22 +0000 Subject: [PATCH] fix len calculation (bug introduced in previous commit). git-svn: trunk@4227 --- libclamav/pdf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libclamav/pdf.c b/libclamav/pdf.c index e4d8a8dee..dc3ea5413 100644 --- a/libclamav/pdf.c +++ b/libclamav/pdf.c @@ -280,7 +280,7 @@ cli_pdf(const char *dir, int desc, cli_ctx *ctx, off_t offset) if((bytesleft > 11) && strncmp(q, " 0 R", 4) == 0) { const char *r, *nq; int opt_failed = 0; - size_t len = size; + size_t len; char b[14]; q += 4; @@ -292,6 +292,7 @@ cli_pdf(const char *dir, int desc, cli_ctx *ctx, off_t offset) /* optimization: assume objects * are sequential */ nq = q; + len = buf + size - q; do { r = cli_pmemstr(nq, len, b, length); if (r > nq) {