]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR:31858
authorJim Jagielski <jim@apache.org>
Wed, 12 Oct 2005 13:38:00 +0000 (13:38 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 12 Oct 2005 13:38:00 +0000 (13:38 +0000)
Fix hsregex core dumps on 64 bit machines. Tested on 32bit Solaris
and OS X/Darwin.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@314900 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/regex/regexec.c

index 1eaaf15e3180e4ba478f723feaa23a8c6121d9ba..6eae856c99cda64ae861a095cb44c3b7c3e1e7c0 100644 (file)
@@ -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
index d2f0a00bf69f650c6a30134ff19fccd4cb7c59ce..9ef2b8c882ab159c651d59c2c335314abc495d4c 100644 (file)
@@ -21,27 +21,27 @@ static int nope = 0;                /* for use in asserts; shuts lint up */
 #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 */