apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r617375 - /apr/apr/trunk/threadproc/unix/signals.c
Date Fri, 01 Feb 2008 08:56:58 GMT
Author: martin
Date: Fri Feb  1 00:56:55 2008
New Revision: 617375

URL: http://svn.apache.org/viewvc?rev=617375&view=rev
Log:
Check for bogus (negative) signal numbers

Modified:
    apr/apr/trunk/threadproc/unix/signals.c

Modified: apr/apr/trunk/threadproc/unix/signals.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/unix/signals.c?rev=617375&r1=617374&r2=617375&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/signals.c (original)
+++ apr/apr/trunk/threadproc/unix/signals.c Fri Feb  1 00:56:55 2008
@@ -116,7 +116,7 @@
 }
 const char *apr_signal_description_get(int signum)
 {
-    return sys_siglist[signum];
+    return (signum >= 0) ? sys_siglist[signum] : "unknown signal (number)";
 }
 
 #else /* !(SYS_SIGLIST_DECLARED || HAVE_DECL_SYS_SIGLIST) */
@@ -262,7 +262,7 @@
 const char *apr_signal_description_get(int signum)
 {
     return
-        signum < APR_NUMSIG
+        (signum >= 0 && signum < APR_NUMSIG)
         ? signal_description[signum]
         : "unknown signal (number)";
 }



Mime
View raw message