[mod_nss] Use memmove in place of memcpy since the buffers can overlap

rcritten rcritten at fedoraproject.org
Wed Jan 12 19:08:11 UTC 2011


commit 7884b1d670b515703ab3c09898e604aaba9fa6e1
Author: Rob Crittenden <rcritten at redhat.com>
Date:   Wed Jan 12 13:21:52 2011 -0500

    Use memmove in place of memcpy since the buffers can overlap
    
    Resolves: #669118

 mod_nss-overlapping_memcpy.patch |   24 ++++++++++++++++++++++++
 mod_nss.spec                     |    5 ++++-
 2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/mod_nss-overlapping_memcpy.patch b/mod_nss-overlapping_memcpy.patch
new file mode 100644
index 0000000..c60e435
--- /dev/null
+++ b/mod_nss-overlapping_memcpy.patch
@@ -0,0 +1,24 @@
+Bug 669118
+
+memcpy of overlapping memory is no longer allowed by glibc.
+
+This is mod_ssl bug https://issues.apache.org/bugzilla/show_bug.cgi?id=45444
+
+--- mod_nss-1.0.8.orig/nss_engine_io.c	2011-01-12 12:31:27.339425702 -0500
++++ mod_nss-1.0.8/nss_engine_io.c	2011-01-12 12:31:35.507405595 -0500
+@@ -123,13 +123,13 @@
+ 
+     if (buffer->length > inl) {
+         /* we have have enough to fill the caller's buffer */
+-        memcpy(in, buffer->value, inl);
++        memmove(in, buffer->value, inl);
+         buffer->value += inl;
+         buffer->length -= inl;
+     }
+     else {
+         /* swallow remainder of the buffer */
+-        memcpy(in, buffer->value, buffer->length);
++        memmove(in, buffer->value, buffer->length);
+         inl = buffer->length;
+         buffer->value = NULL;
+         buffer->length = 0;
diff --git a/mod_nss.spec b/mod_nss.spec
index d699ce8..1ae579e 100644
--- a/mod_nss.spec
+++ b/mod_nss.spec
@@ -1,6 +1,6 @@
 Name: mod_nss
 Version: 1.0.8
-Release: 10%{?dist}
+Release: 11%{?dist}
 Summary: SSL/TLS module for the Apache HTTP server
 Group: System Environment/Daemons
 License: ASL 2.0
@@ -120,6 +120,9 @@ fi
 %{_sbindir}/gencert
 
 %changelog
+* Wed Jan 12 2011 Rob Crittenden <rcritten at redhat.com> - 1.0.8-11
+- Use memmove in place of memcpy since the buffers can overlap (#669118)
+
 * Wed Sep 29 2010 jkeating - 1.0.8-10
 - Rebuilt for gcc bug 634757
 


More information about the scm-commits mailing list