From: Jim Jagielski Date: Wed, 12 Oct 2005 13:38:00 +0000 (+0000) Subject: PR:31858 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb4690996013f37e6560280a0eb774a13942fd23;p=thirdparty%2Fapache%2Fhttpd.git PR:31858 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 --- diff --git a/src/CHANGES b/src/CHANGES index 1eaaf15e318..6eae856c99c 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -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 diff --git a/src/regex/regexec.c b/src/regex/regexec.c index d2f0a00bf69..9ef2b8c882a 100644 --- a/src/regex/regexec.c +++ b/src/regex/regexec.c @@ -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 */