summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2010-08-31 00:34:19 +1000
committerTony Cook <tony@develop-help.com>2010-08-31 00:34:19 +1000
commit17cffb3718693d45499c002f0f50df9196858f28 (patch)
treebf386dae7feb0ee0b4f0cd50286393e3ca861146 /ext
parent8df6b97c1de8326d50ac9c8cae4bf716393b45bb (diff)
downloadperl-17cffb3718693d45499c002f0f50df9196858f28.tar.gz
rt77432: sigaction would crash/assert with a replaced %SIG
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs2
-rw-r--r--ext/POSIX/t/sigaction.t9
2 files changed, 9 insertions, 2 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 7bdd6339b7..2b9af9501a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1471,7 +1471,7 @@ sigaction(sig, optaction, oldaction = 0)
right settings, including appropriate interpretation
of DEFAULT and IGNORE. However, why are we doing
this when we're about to do it again just below? XXX */
- mg_set(*sigsvp);
+ SvSETMAGIC(*sigsvp);
/* And here again we duplicate -- DEFAULT/IGNORE checking. */
if(SvPOK(*svp)) {
diff --git a/ext/POSIX/t/sigaction.t b/ext/POSIX/t/sigaction.t
index bb1b715785..5e2a6adf3f 100644
--- a/ext/POSIX/t/sigaction.t
+++ b/ext/POSIX/t/sigaction.t
@@ -11,7 +11,7 @@ BEGIN{
}
}
-use Test::More tests => 31;
+use Test::More tests => 32;
use strict;
use vars qw/$bad $bad7 $ok10 $bad18 $ok/;
@@ -204,3 +204,10 @@ SKIP: {
eval { sigaction(-999, "foo"); };
like($@, qr/Negative signals/,
"Prevent negative signals instead of core dumping");
+
+# RT 77432 - assertion failure with POSIX::SigAction
+{
+ local *SIG = {};
+ ok(sigaction(SIGHUP, POSIX::SigAction->new),
+ "sigaction would crash/assert with a replaced %SIG");
+}