Browse code

Fix 'Unknown error code ERROR' (bb #2296).

CL_BREAK from cli_bytecode_runhook must not be allowed escape.
Affects only pdf.c, since in pdf.c we return CL_CLEAN when ret != CL_VIRUS.

Török Edvin authored on 2010/10/06 00:15:32
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Oct  5 18:14:59 EEST 2010 (edwin)
2
+-------------------------------------
3
+ * libclamav/pdf.c: Fix 'Unknown error code ERROR'(bb #2296).
4
+
1 5
 Tue Oct  5 17:03:43 EEST 2010 (edwin)
2 6
 -------------------------------------
3 7
  * libclamav/pdf.c: Fix crash on 64-bit Solaris Intel (bb #2314).
... ...
@@ -1088,7 +1088,7 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
1088 1088
     rc = run_pdf_hooks(&pdf, PDF_PHASE_PRE, -1, -1);
1089 1089
     if (rc) {
1090 1090
 	cli_dbgmsg("cli_pdf: returning %d\n", rc);
1091
-	return rc;
1091
+	return rc == CL_BREAK ? CL_CLEAN : rc;
1092 1092
     }
1093 1093
     /* parse PDF and find obj offsets */
1094 1094
     while ((rc = pdf_findobj(&pdf)) > 0) {