Change 27440 by [EMAIL PROTECTED] on 2006/03/09 16:03:21

        croak in POSIX::sigaction() when passed a negative signal instead
        dumping core.

Affected files ...

... //depot/perl/ext/POSIX/POSIX.xs#142 edit
... //depot/perl/ext/POSIX/t/sigaction.t#17 edit

Differences ...

==== //depot/perl/ext/POSIX/POSIX.xs#142 (text) ====
Index: perl/ext/POSIX/POSIX.xs
--- perl/ext/POSIX/POSIX.xs#141~26901~  2006-01-18 06:23:09.000000000 -0800
+++ perl/ext/POSIX/POSIX.xs     2006-03-09 08:03:21.000000000 -0800
@@ -1260,6 +1260,10 @@
            SV** svp;
            SV** sigsvp;
 
+            if (sig < 0) {
+                croak("Negative signals are not allowed");
+            }
+
            if (sig == 0 && SvPOK(ST(0))) {
                const char *s = SvPVX_const(ST(0));
                int i = whichsig(s);

==== //depot/perl/ext/POSIX/t/sigaction.t#17 (text) ====
Index: perl/ext/POSIX/t/sigaction.t
--- perl/ext/POSIX/t/sigaction.t#16~25975~      2005-11-03 08:00:12.000000000 
-0800
+++ perl/ext/POSIX/t/sigaction.t        2006-03-09 08:03:21.000000000 -0800
@@ -205,3 +205,6 @@
     kill 'HUP', $$;
 }
 
+eval { sigaction(-999, "foo"); };
+like($@, qr/Negative signals/,
+    "Prevent negative signals instead of core dumping");
End of Patch.

Reply via email to