]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r382799 from trunk:
authorJoe Orton <jorton@apache.org>
Fri, 31 Mar 2006 12:25:25 +0000 (12:25 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 31 Mar 2006 12:25:25 +0000 (12:25 +0000)
* 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

CHANGES
modules/ssl/ssl_scache_shmcb.c

diff --git a/CHANGES b/CHANGES
index 49772716718561cec9c57d9d7a44dc06892cdf00..e8a8bcd1eea5971951e369b0d7aa9ed370a0251a 100644 (file)
--- 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]
index 024d1955ad153b0bee2479d908d4e7d07a9546dc..5402940ae62ee824f24cdae2ca0610a2f865c31e 100644 (file)
@@ -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);