From: Joe Orton Date: Fri, 31 Mar 2006 12:25:25 +0000 (+0000) Subject: Merge r382799 from trunk: X-Git-Tag: 2.2.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=591f1e4f39a9a0acca092c9f92de459a1b7f8c56;p=thirdparty%2Fapache%2Fhttpd.git Merge r382799 from trunk: * modules/ssl/ssl_scache_shmcb.c (shmcb_safe_clear): Mark with "noinline" attribute for GCC > 3. PR: 38838 Reviewed by: jorton, rpluem, pquerna git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390405 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 49772716718..e8a8bcd1eea 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.1 + *) mod_ssl: Fix possible crashes in shmcb with gcc 4 on platforms + requiring word-aligned pointers. PR 38838. [Joe Orton] + *) mod_proxy: If we get an error reading the upstream response, close the connection. [Justin Erenkrantz, Roy T. Fielding, Jim Jagielski, Ruediger Pluem] diff --git a/modules/ssl/ssl_scache_shmcb.c b/modules/ssl/ssl_scache_shmcb.c index 024d1955ad1..5402940ae62 100644 --- a/modules/ssl/ssl_scache_shmcb.c +++ b/modules/ssl/ssl_scache_shmcb.c @@ -234,8 +234,13 @@ static void shmcb_set_safe_time_ex(unsigned char *, const unsigned char *); (const unsigned char *)(&tmp_time)); \ } while(0) -/* This is necessary simply so that the size passed to memset() is not a - * compile-time constant, preventing the compiler from optimising it. */ +/* This is used to persuade the compiler from using an inline memset() + * which has no respect for alignment, since the size parameter is + * often a compile-time constant. GCC >= 4 will aggressively inline + * static functions, so it's marked as explicitly not-inline. */ +#if defined(__GNUC__) && __GNUC__ > 3 +__attribute__((__noinline__)) +#endif static void shmcb_safe_clear(void *ptr, size_t size) { memset(ptr, 0, size);