Browse code

Bug 618, --block-max not always honoured

git-svn: trunk@3173

Nigel Horne authored on 2007/08/18 22:23:20
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Aug 18 13:25:52 BST 2007 (njh)
2
+----------------------------------
3
+  * libclamav/pdf.c:	Bug 618, --block-max not always honoured
4
+
1 5
 Tue Aug 14 23:23:00 EEST 2007 (edwin)
2 6
 ----------------------------------
3 7
   * libclamav/phishcheck.c, regex_list.c, phish_whitelist.c: make debug output
... ...
@@ -213,7 +213,7 @@ cli_pdf(const char *dir, int desc, const cli_ctx *ctx)
213 213
 	/*
214 214
 	 * The body section consists of a sequence of indirect objects
215 215
 	 */
216
-	while((p < xrefstart) &&
216
+	while((p < xrefstart) && (rc == CL_CLEAN) &&
217 217
 	      ((q = pdf_nextobject(p, bytesleft)) != NULL)) {
218 218
 		int is_ascii85decode, is_flatedecode, fout, len, has_cr;
219 219
 		/*int object_number, generation_number;*/
... ...
@@ -421,7 +421,7 @@ cli_pdf(const char *dir, int desc, const cli_ctx *ctx)
421 421
 		 * Calculate the length ourself, the Length parameter is often
422 422
 		 * wrong
423 423
 		 */
424
-		if(*--streamend != '\n')
424
+		if((*--streamend != '\n') && (*streamend != '\r'))
425 425
 			streamend++;
426 426
 		else if(has_cr && (*--streamend != '\r'))
427 427
 			streamend++;