httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r314900 - in /httpd/httpd/branches/1.3.x/src: CHANGES regex/regexec.c
Date Wed, 12 Oct 2005 13:38:02 GMT
Author: jim
Date: Wed Oct 12 06:38:00 2005
New Revision: 314900

URL: http://svn.apache.org/viewcvs?rev=314900&view=rev
Log:
PR:31858
Fix hsregex core dumps on 64 bit machines. Tested on 32bit Solaris
and OS X/Darwin.


Modified:
    httpd/httpd/branches/1.3.x/src/CHANGES
    httpd/httpd/branches/1.3.x/src/regex/regexec.c

Modified: httpd/httpd/branches/1.3.x/src/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/1.3.x/src/CHANGES?rev=314900&r1=314899&r2=314900&view=diff
==============================================================================
--- httpd/httpd/branches/1.3.x/src/CHANGES (original)
+++ httpd/httpd/branches/1.3.x/src/CHANGES Wed Oct 12 06:38:00 2005
@@ -1,5 +1,8 @@
 Changes with Apache 1.3.34
 
+  *) hsregex: fix potential core dumping on 64 bit machines, such as
+     AMD64. PR 31858. [Glenn Strauss < gs-apache-dev gluelogic.com>]
+
   *) SECURITY: core: If a request contains both Transfer-Encoding and 
      Content-Length headers, remove the Content-Length, mitigating some 
      HTTP Request Splitting/Spoofing attacks.  This has no impact on

Modified: httpd/httpd/branches/1.3.x/src/regex/regexec.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/1.3.x/src/regex/regexec.c?rev=314900&r1=314899&r2=314900&view=diff
==============================================================================
--- httpd/httpd/branches/1.3.x/src/regex/regexec.c (original)
+++ httpd/httpd/branches/1.3.x/src/regex/regexec.c Wed Oct 12 06:38:00 2005
@@ -21,27 +21,27 @@
 #endif
 
 /* macros for manipulating states, small version */
-#define	states	long
+#define	states	unsigned long
 #define	states1	states		/* for later use in regexec() decision */
-#define	CLEAR(v)	((v) = 0)
-#define	SET0(v, n)	((v) &= ~(1 << (n)))
-#define	SET1(v, n)	((v) |= 1 << (n))
-#define	ISSET(v, n)	((v) & (1 << (n)))
+#define	CLEAR(v)	((v) = 0uL)
+#define	SET0(v, n)	((v) &= ~(1uL << (n)))
+#define	SET1(v, n)	((v) |= 1uL << (n))
+#define	ISSET(v, n)	((v) & (1uL << (n)))
 #define	ASSIGN(d, s)	((d) = (s))
 #define	EQ(a, b)	((a) == (b))
 #define	STATEVARS	int dummy	/* dummy version */
 #define	STATESETUP(m, n)	/* nothing */
 #define	STATETEARDOWN(m)	/* nothing */
-#define	SETUP(v)	((v) = 0)
-#define	onestate	int
-#define	INIT(o, n)	((o) = (unsigned)1 << (n))
+#define	SETUP(v)	((v) = 0uL)
+#define	onestate	unsigned long
+#define	INIT(o, n)	((o) = 1uL << (n))
 #define	INC(o)	((o) <<= 1)
 #define	ISSTATEIN(v, o)	((v) & (o))
 /* some abbreviations; note that some of these know variable names! */
 /* do "if I'm here, I can also be there" etc without branches */
-#define	FWD(dst, src, n)	((dst) |= ((unsigned)(src)&(here)) << (n))
-#define	BACK(dst, src, n)	((dst) |= ((unsigned)(src)&(here)) >> (n))
-#define	ISSETBACK(v, n)	((v) & ((unsigned)here >> (n)))
+#define	FWD(dst, src, n)	((dst) |= ((src)&(here)) << (n))
+#define	BACK(dst, src, n)	((dst) |= ((src)&(here)) >> (n))
+#define	ISSETBACK(v, n)	((v) & (here >> (n))) != 0uL
 /* function names */
 #define SNAMES			/* engine.c looks after details */
 



Mime
View raw message