[Forensics-changes] [yara] 18/415: Bug fix: access violation on xxcompare functions

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:42:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit 4c0a401b49571022e35669c03f0b66fd180a11e6
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Fri Feb 27 11:35:41 2009 +0000

    Bug fix: access violation on xxcompare functions
---
 ChangeLog              |  3 ++-
 Makefile               |  6 ++---
 config.h               |  6 ++---
 configure              | 20 +++++++--------
 libyara/libyara.tmproj | 68 ++++++++++++++++++++++++++------------------------
 libyara/scan.c         | 11 +++++---
 6 files changed, 61 insertions(+), 53 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0a89ff4..309efc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,7 @@ version 1.1 (05/01/2009)
 	* regular expressions syntax changed
 	* now regular expressions can begin with any character
 
-version 1.2
+version 1.2 (13/01/2009)
 	* added support for global rules
 	* added support for declaring alternative sub-strings in hex strings
 	* added support for anonymous strings
@@ -30,4 +30,5 @@ version 1.2.1
 	* BUGFIX: Invoking pcre_compile with non-terminated string
 	* BUGFIX: Underscore (_) not recongnized in string identifiers
 	* BUGFIX: Memory leak
+	* BUGFIX: Access violation on xxcompare functions
 	
diff --git a/Makefile b/Makefile
index f3f398e..d6dd193 100644
--- a/Makefile
+++ b/Makefile
@@ -117,14 +117,14 @@ OBJEXT = o
 PACKAGE = yara
 PACKAGE_BUGREPORT = vmalvarez at hispasec.com
 PACKAGE_NAME = yara
-PACKAGE_STRING = yara 1.2
+PACKAGE_STRING = yara 1.2.1
 PACKAGE_TARNAME = yara
-PACKAGE_VERSION = 1.2
+PACKAGE_VERSION = 1.2.1
 PATH_SEPARATOR = :
 SET_MAKE = 
 SHELL = /bin/sh
 STRIP = 
-VERSION = 1.2
+VERSION = 1.2.1
 abs_builddir = /Users/plusvic/Projects/yara/trunk
 abs_srcdir = /Users/plusvic/Projects/yara/trunk
 abs_top_builddir = /Users/plusvic/Projects/yara/trunk
diff --git a/config.h b/config.h
index 60118e0..a6fafc2 100644
--- a/config.h
+++ b/config.h
@@ -14,13 +14,13 @@
 #define PACKAGE_NAME "yara"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "yara 1.2"
+#define PACKAGE_STRING "yara 1.2.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "yara"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.2"
+#define PACKAGE_VERSION "1.2.1"
 
 /* Version number of package */
-#define VERSION "1.2"
+#define VERSION "1.2.1"
diff --git a/configure b/configure
index 312e35b..299d986 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yara 1.2.
+# Generated by GNU Autoconf 2.61 for yara 1.2.1.
 #
 # Report bugs to <vmalvarez at hispasec.com>.
 #
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='yara'
 PACKAGE_TARNAME='yara'
-PACKAGE_VERSION='1.2'
-PACKAGE_STRING='yara 1.2'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='yara 1.2.1'
 PACKAGE_BUGREPORT='vmalvarez at hispasec.com'
 
 ac_subst_vars='SHELL
@@ -1167,7 +1167,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures yara 1.2 to adapt to many kinds of systems.
+\`configure' configures yara 1.2.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1233,7 +1233,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of yara 1.2:";;
+     short | recursive ) echo "Configuration of yara 1.2.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1316,7 +1316,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-yara configure 1.2
+yara configure 1.2.1
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1330,7 +1330,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by yara $as_me 1.2, which was
+It was created by yara $as_me 1.2.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2020,7 +2020,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='yara'
- VERSION='1.2'
+ VERSION='1.2.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3973,7 +3973,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by yara $as_me 1.2, which was
+This file was extended by yara $as_me 1.2.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4026,7 +4026,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-yara config.status 1.2
+yara config.status 1.2.1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/libyara/libyara.tmproj b/libyara/libyara.tmproj
index 84f0eda..2fe190b 100644
--- a/libyara/libyara.tmproj
+++ b/libyara/libyara.tmproj
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>currentDocument</key>
-	<string>lex.l</string>
+	<string>ast.c</string>
 	<key>documents</key>
 	<array>
 		<dict>
@@ -13,13 +13,13 @@
 					<key>filename</key>
 					<string>scan.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T15:37:58Z</date>
+					<date>2009-02-17T13:19:30Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>pefile.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T15:06:24Z</date>
+					<date>2009-02-17T13:21:19Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
@@ -31,45 +31,45 @@
 					<key>filename</key>
 					<string>eval.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T14:11:25Z</date>
+					<date>2009-02-17T13:21:20Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>error.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T15:19:34Z</date>
+					<date>2009-02-17T14:51:49Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>compile.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T15:37:49Z</date>
+					<date>2009-02-17T13:20:15Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>ast.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-11T18:35:44Z</date>
+					<date>2009-02-18T09:06:25Z</date>
+					<key>selected</key>
+					<true/>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>lex.l</string>
 					<key>lastUsed</key>
-					<date>2009-02-16T16:49:41Z</date>
-					<key>selected</key>
-					<true/>
+					<date>2009-02-17T15:52:57Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>grammar.y</string>
 					<key>lastUsed</key>
-					<date>2009-02-16T16:49:41Z</date>
+					<date>2009-02-17T13:48:13Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>../yara.c</string>
 					<key>lastUsed</key>
-					<date>2009-02-16T16:49:37Z</date>
+					<date>2009-02-17T13:19:55Z</date>
 				</dict>
 			</array>
 			<key>expanded</key>
@@ -84,7 +84,7 @@
 					<key>filename</key>
 					<string>yara.h</string>
 					<key>lastUsed</key>
-					<date>2009-02-12T15:28:19Z</date>
+					<date>2009-02-17T13:58:12Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
@@ -132,13 +132,13 @@
 					<key>filename</key>
 					<string>ast.h</string>
 					<key>lastUsed</key>
-					<date>2009-02-11T17:44:01Z</date>
+					<date>2009-02-17T14:53:31Z</date>
 				</dict>
 				<dict>
 					<key>filename</key>
 					<string>sizedstr.h</string>
 					<key>lastUsed</key>
-					<date>2009-01-22T20:31:21Z</date>
+					<date>2009-02-17T13:58:18Z</date>
 				</dict>
 			</array>
 			<key>expanded</key>
@@ -163,21 +163,21 @@
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>68</integer>
+			<integer>353</integer>
 		</dict>
 		<key>ast.c</key>
 		<dict>
 			<key>caret</key>
 			<dict>
 				<key>column</key>
-				<integer>0</integer>
+				<integer>52</integer>
 				<key>line</key>
-				<integer>674</integer>
+				<integer>459</integer>
 			</dict>
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>630</integer>
+			<integer>432</integer>
 		</dict>
 		<key>ast.h</key>
 		<dict>
@@ -191,7 +191,7 @@
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>115</integer>
+			<integer>93</integer>
 		</dict>
 		<key>compile.c</key>
 		<dict>
@@ -226,14 +226,14 @@
 			<key>caret</key>
 			<dict>
 				<key>column</key>
-				<integer>27</integer>
+				<integer>0</integer>
 				<key>line</key>
-				<integer>65</integer>
+				<integer>34</integer>
 			</dict>
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>0</integer>
+			<integer>94</integer>
 		</dict>
 		<key>error.h</key>
 		<dict>
@@ -324,28 +324,28 @@
 			<key>caret</key>
 			<dict>
 				<key>column</key>
-				<integer>34</integer>
+				<integer>42</integer>
 				<key>line</key>
-				<integer>727</integer>
+				<integer>569</integer>
 			</dict>
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>698</integer>
+			<integer>216</integer>
 		</dict>
 		<key>lex.l</key>
 		<dict>
 			<key>caret</key>
 			<dict>
 				<key>column</key>
-				<integer>20</integer>
+				<integer>38</integer>
 				<key>line</key>
-				<integer>110</integer>
+				<integer>165</integer>
 			</dict>
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>134</integer>
+			<integer>170</integer>
 		</dict>
 		<key>pefile.c</key>
 		<dict>
@@ -359,7 +359,7 @@
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>12</integer>
+			<integer>54</integer>
 		</dict>
 		<key>pefile.h</key>
 		<dict>
@@ -387,7 +387,7 @@
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>831</integer>
+			<integer>645</integer>
 		</dict>
 		<key>sizedstr.h</key>
 		<dict>
@@ -417,7 +417,7 @@
 			<key>firstVisibleColumn</key>
 			<integer>0</integer>
 			<key>firstVisibleLine</key>
-			<integer>59</integer>
+			<integer>11</integer>
 			<key>selectFrom</key>
 			<dict>
 				<key>column</key>
@@ -439,14 +439,18 @@
 		<string>filemap.c</string>
 		<string>filemap.h</string>
 		<string>yara.h</string>
+		<string>sizedstr.h</string>
 		<string>compile.c</string>
 		<string>error.c</string>
 		<string>error.h</string>
 		<string>pefile.c</string>
+		<string>eval.c</string>
 		<string>../yara.c</string>
 		<string>grammar.y</string>
 		<string>lex.l</string>
 		<string>scan.c</string>
+		<string>ast.c</string>
+		<string>ast.h</string>
 	</array>
 	<key>showFileHierarchyDrawer</key>
 	<true/>
diff --git a/libyara/scan.c b/libyara/scan.c
index 93a8411..c8b5d59 100644
--- a/libyara/scan.c
+++ b/libyara/scan.c
@@ -47,7 +47,7 @@ inline int compare(char* str1, char* str2, int len)
 	char* s2 = str2;
 	int i = 0;
 	
-	while (*s1++ == *s2++ && i < len) 
+	while (i < len && *s1++ == *s2++) 
 	{
 	    i++;
     }
@@ -61,7 +61,10 @@ inline int icompare(char* str1, char* str2, int len)
 	char* s2 = str2;
 	int i = 0;
 	
-	while (tolower(*s1++) == tolower(*s2++) && i < len) i++;
+	while (i < len && tolower(*s1++) == tolower(*s2++)) 
+	{
+	    i++;
+    }
 	
 	return ((i==len) ? i : 0);
 }
@@ -73,7 +76,7 @@ inline int wcompare(char* str1, char* str2, int len)
 	char* s2 = str2;
 	int i = 0;
 
-	while (*s1 == *s2 && i < len) 
+	while (i < len && *s1 == *s2) 
 	{
 		s1++;
 		s2+=2;
@@ -89,7 +92,7 @@ inline int wicompare(char* str1, char* str2, int len)
 	char* s2 = str2;
 	int i = 0;
 
-	while (tolower(*s1) == tolower(*s2) && i < len) 
+	while (i < len && tolower(*s1) == tolower(*s2)) 
 	{
 		s1++;
 		s2+=2;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list