This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change newSVpv() to newSVpvn() where we know the length is non-zero, as
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index 4e3504c..00b0c71 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1245,7 +1245,7 @@ Perl_magic_clearsig(pTHX_ SV *sv, MAGIC *mg)
            sigaddset(&set,i);
            sigprocmask(SIG_BLOCK, &set, &save);
            ENTER;
-           save_sv = newSVpv((char *)(&save), sizeof(sigset_t));
+           save_sv = newSVpvn((char *)(&save), sizeof(sigset_t));
            SAVEFREESV(save_sv);
            SAVEDESTRUCTOR_X(restore_sigmask, save_sv);
 #endif
@@ -1442,7 +1442,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
        sigaddset(&set,i);
        sigprocmask(SIG_BLOCK, &set, &save);
        ENTER;
-       save_sv = newSVpv((char *)(&save), sizeof(sigset_t));
+       save_sv = newSVpvn((char *)(&save), sizeof(sigset_t));
        SAVEFREESV(save_sv);
        SAVEDESTRUCTOR_X(restore_sigmask, save_sv);
 #endif
@@ -2876,7 +2876,7 @@ Perl_sighandler(int sig)
 #endif
                   EXTEND(SP, 2);
                   PUSHs((SV*)rv);
-                  PUSHs(newSVpv((char *)sip, sizeof(*sip)));
+                  PUSHs(newSVpvn((char *)sip, sizeof(*sip)));
              }
 
         }