Browse code

#include clamav-config.h

git-svn: trunk@1774

Trog authored on 2005/11/30 01:33:06
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Nov 29 16:31:23 GMT 2005 (trog)
2
+-----------------------------------
3
+  * libclamav/unrar/unrar.c unrarvm.c: #include clamav-config.h
4
+
1 5
 Mon Nov 28 20:45:20 CET 2005 (tk)
2 6
 ---------------------------------
3 7
   * configure.in: check for hardware acceleration library (--disable-hwaccel
... ...
@@ -20,6 +20,10 @@
20 20
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 21
  */
22 22
 
23
+#if HAVE_CONFIG_H
24
+#include "clamav-config.h"
25
+#endif
26
+
23 27
 #include <sys/types.h>
24 28
 #include <sys/stat.h>
25 29
 #include <fcntl.h>
... ...
@@ -20,6 +20,10 @@
20 20
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 21
  */
22 22
 
23
+#if HAVE_CONFIG_H
24
+#include "clamav-config.h"
25
+#endif
26
+
23 27
 #include <string.h>
24 28
 
25 29
 #include "unrar.h"
... ...
@@ -586,6 +590,14 @@ static int rarvm_execute_code(rarvm_data_t *rarvm_data,
586 586
 	rar_dbgmsg("in rarvm_execute_code\n");
587 587
 	cmd = prepared_code;
588 588
 	while (1) {
589
+		if (cmd > (prepared_code + code_size)) {
590
+			cli_dbgmsg("RAR: code overrun detected\n");
591
+			return FALSE;
592
+		}
593
+		if (cmd < prepared_code) {
594
+			cli_dbgmsg("RAR: code underrun detected\n");
595
+                        return FALSE;
596
+                }
589 597
 		op1 = rarvm_get_operand(rarvm_data, &cmd->op1);
590 598
 		op2 = rarvm_get_operand(rarvm_data, &cmd->op2);
591 599
 		rar_dbgmsg("op(%d) op_code: %d, op1=%u, op2=%u\n", 25000000-max_ops,