[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix bug with tor_memmem finding a match at the end of the s...



Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv24674/src/common

Modified Files:
	compat.c 
Log Message:
Fix bug with tor_memmem finding a match at the end of the string.

Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- compat.c	3 Aug 2005 17:16:48 -0000	1.63
+++ compat.c	22 Aug 2005 00:34:23 -0000	1.64
@@ -161,7 +161,7 @@
   end = haystack + hlen;
   first = *(const char*)needle;
   while ((p = memchr(p, first, end-p))) {
-    if (p+nlen >= end)
+    if (p+nlen > end)
       return NULL;
     if (!memcmp(p, needle, nlen))
       return p;