rpms/slang/devel slang-2.1.2-hashborder.patch, NONE, 1.1 slang-2.1.2-slerr.patch, NONE, 1.1 slang.spec, 1.47, 1.48

Miroslav Lichvar (mlichvar) fedora-extras-commits at redhat.com
Tue Sep 25 15:37:04 UTC 2007


Author: mlichvar

Update of /cvs/pkgs/rpms/slang/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18527

Modified Files:
	slang.spec 
Added Files:
	slang-2.1.2-hashborder.patch slang-2.1.2-slerr.patch 
Log Message:
- fix integer underflow in compute_hash (#302181)
- fix SLang_set_error when called from signal handler (#297661)


slang-2.1.2-hashborder.patch:

--- NEW FILE slang-2.1.2-hashborder.patch ---
diff -up slang-2.1.2/src/slsmg.c.hashborder slang-2.1.2/src/slsmg.c
--- slang-2.1.2/src/slsmg.c.hashborder	2007-09-17 19:17:24.000000000 +0200
+++ slang-2.1.2/src/slsmg.c	2007-09-24 17:23:29.000000000 +0200
@@ -993,7 +993,7 @@ static unsigned long compute_hash (SLsmg
 
    c += SLsmg_Scroll_Hash_Border;
    csave = c;
-   cmax = c + (n - SLsmg_Scroll_Hash_Border);
+   cmax = c + ((int)n - SLsmg_Scroll_Hash_Border);
 
    while ((c < cmax) && is_blank)
      {

slang-2.1.2-slerr.patch:

--- NEW FILE slang-2.1.2-slerr.patch ---
Index: slang/src/slerr.c
===================================================================
--- slang/src/slerr.c	(revision 199)
+++ slang/src/slerr.c	(revision 200)
@@ -384,6 +384,8 @@
 }
 Error_Message_Type;
 
+static char *Static_Error_Message = NULL;
+
 struct _pSLerr_Error_Queue_Type
 {
    Error_Message_Type *head;
@@ -531,12 +533,11 @@
 	
 	free_queued_messages (q);
      }
-#if 0
-   if (_pSLang_Error != SL_Usage_Error)
+   if (Static_Error_Message != NULL)
      {
-	print_error (_SLERR_MSG_ERROR, SLerr_strerror (_pSLang_Error));
+	print_error (_SLERR_MSG_ERROR, Static_Error_Message);
+	Static_Error_Message = NULL;
      }
-#endif
 }
 
 /* This function returns a pointer to the first error message in the queue.
@@ -615,6 +616,7 @@
 
 void _pSLerr_free_queued_messages (void)
 {
+   Static_Error_Message = NULL;
    free_queued_messages (Active_Error_Queue);
 }
 
@@ -626,7 +628,10 @@
     */
    if ((error == 0)
        || (_pSLang_Error == 0))
-     _pSLang_Error = error;
+     {
+	Static_Error_Message = NULL;
+	_pSLang_Error = error;
+     }
 
    if (_pSLinterpreter_Error_Hook != NULL)
      (*_pSLinterpreter_Error_Hook) (_pSLang_Error);
@@ -707,9 +712,19 @@
 {
    set_error (error);
 
-   if (_pSLang_Error == 0)
+   if (error == 0)
      return 0;
 
+   if (error == SL_UserBreak_Error)
+     {
+	/* This function may be called from a SIGINT handler, in which case the 
+	 * error code will be SL_Usage_Error.
+	 */
+	/* print_error (_SLERR_MSG_ERROR, SLerr_strerror (_pSLang_Error)); */
+	Static_Error_Message = SLerr_strerror (error);
+	return 0;
+     }	
+   
    /* If a string is not in the message queue, then add one. */
    if (Active_Error_Queue != NULL)
      {
@@ -806,5 +821,6 @@
    Suspend_Error_Messages = 0;
    Default_Error_Queue = NULL;
    Active_Error_Queue = NULL;
+   Static_Error_Message = NULL;
 }
 


Index: slang.spec
===================================================================
RCS file: /cvs/pkgs/rpms/slang/devel/slang.spec,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- slang.spec	17 Sep 2007 17:27:03 -0000	1.47
+++ slang.spec	25 Sep 2007 15:36:31 -0000	1.48
@@ -1,13 +1,15 @@
 Summary: The shared library for the S-Lang extension language
 Name: slang
 Version: 2.1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 Source: ftp://space.mit.edu/pub/davis/slang/v2.1/%{name}-%{version}.tar.bz2
 Patch1: slang-2.1.2-makefile.patch
 Patch2: slang-nointerlibc2.patch
 Patch3: slang-LANG.patch
+Patch4: slang-2.1.2-hashborder.patch
+Patch5: slang-2.1.2-slerr.patch
 URL: http://www.jedsoft.org/slang/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libpng-devel pcre-devel gawk
@@ -60,6 +62,8 @@
 %patch1 -p1 -b .makefile
 %patch2 -p1 -b .nointerlibc2
 %patch3 -p1 -b .LANG
+%patch4 -p1 -b .hashborder
+%patch5 -p1 -b .slerr
 
 %build
 %configure --includedir=%{_includedir}/slang
@@ -103,6 +107,10 @@
 %{_libdir}/libslang*.a
 
 %changelog
+* Tue Sep 25 2007 Miroslav Lichvar <mlichvar at redhat.com> - 2.1.2-2
+- fix integer underflow in compute_hash (#302181)
+- fix SLang_set_error when called from signal handler (#297661)
+
 * Mon Sep 17 2007 Miroslav Lichvar <mlichvar at redhat.com> - 2.1.2-1
 - update to 2.1.2
 




More information about the fedora-extras-commits mailing list