rpms/xemacs/devel xemacs-21.4.17-innerbuf.patch, NONE, 1.1 xemacs.spec, 1.2, 1.3

Ville Skytta (scop) fedora-extras-commits at redhat.com
Thu May 5 19:25:02 UTC 2005


Author: scop

Update of /cvs/extras/rpms/xemacs/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8743

Modified Files:
	xemacs.spec 
Added Files:
	xemacs-21.4.17-innerbuf.patch 
Log Message:
Stack corruption fix from Enrico Scholz, #154112.

xemacs-21.4.17-innerbuf.patch:

--- NEW FILE xemacs-21.4.17-innerbuf.patch ---
2005-04-07 15:08  Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
	* src/process-unix.c (unix_open_network_stream): moved
	  'portbuf' buffer out of an inner block as it is used in the
	  entire function. With gcc4, the stack may get corrupted
	  after leaving this block. This patches adjusts the size of
	  the used buffer also; static '128' bytes are far too much
	  currently and might not suffice for future architectures
	  (e.g. for 512 bit ones ;)). Instead of, use only the really
	  required space (max octets * ln(256)/ln(10) chars + space
	  for '\0' and the sign)

--- xemacs-21.4.17/src/process-unix.c.innerbuf	2005-01-31 03:55:26.000000000 +0100
+++ xemacs-21.4.17/src/process-unix.c	2005-04-07 16:09:36.000000000 +0200
@@ -1670,13 +1670,13 @@
     volatile int xerrno = 0;
     volatile int failed_connect = 0;
     char *ext_host;
+    char portbuf[sizeof(long)*3 + 2];
     /*
      * Caution: service can either be a string or int.
      * Convert to a C string for later use by getaddrinfo.
      */
     if (INTP (service))
       {
-	char portbuf[128];
 	snprintf (portbuf, sizeof (portbuf), "%ld", (long) XINT (service));
 	portstring = portbuf;
 	port = htons ((unsigned short) XINT (service));


Index: xemacs.spec
===================================================================
RCS file: /cvs/extras/rpms/xemacs/devel/xemacs.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xemacs.spec	5 Mar 2005 21:10:25 -0000	1.2
+++ xemacs.spec	5 May 2005 19:24:59 -0000	1.3
@@ -1,7 +1,7 @@
 Summary: Different version of Emacs
 Name: xemacs
 Version: 21.4.17
-Release: 2
+Release: 3
 License: GPL
 Group: Applications/Editors
 Source0: ftp://ftp.xemacs.org/xemacs-21.4/xemacs-%{version}.tar.bz2
@@ -12,6 +12,7 @@
 Source22: delprevline.py
 Source23: dotxemacs-init.el
 Source24: default.el
+Patch0: xemacs-21.4.17-innerbuf.patch
 Patch5: xemacs-21-cursor.patch
 Patch10: xemacs-21.4.10-find-paths-pkgdir.patch
 Patch11: movemail-mktemp.patch
@@ -129,6 +130,7 @@
 sed -i -e "s|\@srcdir\@|$PWD|" lisp/dump-paths.el
 
 ## non-Lisp patches ##
+%patch0 -p1 -b .innerbuf
 %patch5 -p1 -b .cursor
 # movemail
 %patch11 -p1 -b .mkstemp
@@ -363,6 +365,10 @@
 
 
 %changelog
+* Thu May  5 2005 Ville Skyttä <ville.skytta at iki.fi> - 21.4.17-3
+- Avoid stack corruption in open-network-stream when built with gcc4
+  (Enrico Scholz, #154112).
+
 * Tue Mar  1 2005 Ville Skyttä <scop at xemacs.org> - 21.4.17-2
 - Drop xemacs-sumo build dependency and -nox install time dependency on it
   to solve chicken-egg bootstrap problem.




More information about the fedora-extras-commits mailing list