In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/4be3e658104061aa3657d48e859204193abd5030?hp=c6841f364f3bce268876ec3511ee74a818605277>

- Log -----------------------------------------------------------------
commit 4be3e658104061aa3657d48e859204193abd5030
Author: Jarkko Hietaniemi <[email protected]>
Date:   Wed Nov 29 08:22:29 2017 +0200

    assert() that the vlnz is not NULL before using it.
    
    Coverity #169272.

commit b123425910491a792e15d8d4105aa2a31e48bdd3
Author: Jarkko Hietaniemi <[email protected]>
Date:   Wed Nov 29 07:50:15 2017 +0200

    Initialize variables.
    
    Coverity #169257, #169265, #169269.

commit 026633c6d8d2f9ba22e5de49b50579c768369e5e
Author: Jarkko Hietaniemi <[email protected]>
Date:   Wed Nov 29 07:24:50 2017 +0200

    Set safer umask for mkstemp().
    
    Coverity #169258.

commit 8843856e9716655549cce789b3338e1d4c72fffb
Author: Jarkko Hietaniemi <[email protected]>
Date:   Wed Nov 29 07:11:33 2017 +0200

    More robust version of 793c2ded.
    
    In platforms with st.ino always positive, never even see the negative code.
    
    Coverity #169271.

-----------------------------------------------------------------------

Summary of changes:
 doio.c    |  8 +++++++-
 pp_sys.c  | 13 +++++--------
 regcomp.c |  2 ++
 sv.c      |  1 +
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/doio.c b/doio.c
index 7dcbbb5cfb..a99b2c9cb7 100644
--- a/doio.c
+++ b/doio.c
@@ -621,6 +621,8 @@ S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char 
*mode, const char *oname,
 
     PERL_ARGS_ASSERT_OPENN_CLEANUP;
 
+    Zero(&statbuf, 1, Stat_t);
+
     if (!fp) {
        if (IoTYPE(io) == IoTYPE_RDONLY && ckWARN(WARN_NEWLINE)
            && should_warn_nl(oname)
@@ -850,7 +852,11 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV 
*temp_out_name) {
     else
         sv_setpvs(temp_out_name, "XXXXXXXX");
 
-    fd = Perl_my_mkstemp(SvPVX(temp_out_name));
+    {
+      int old_umask = umask(0177);
+      fd = Perl_my_mkstemp(SvPVX(temp_out_name));
+      umask(old_umask);
+    }
 
     if (fd < 0)
         return FALSE;
diff --git a/pp_sys.c b/pp_sys.c
index 47cc761067..30b373bd3a 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3012,18 +3012,13 @@ PP(pp_stat)
             * st_ino; and (d) sprintf() doesn't necessarily support
             * integers as large as st_ino.
             */
-           bool neg;
            Stat_t s;
            CLANG_DIAG_IGNORE(-Wtautological-compare);
            GCC_DIAG_IGNORE(-Wtype-limits);
-#if ST_INO_SIGN == -1
-           neg = PL_statcache.st_ino < 0;
-#else
-           neg = FALSE;
-#endif
            GCC_DIAG_RESTORE;
            CLANG_DIAG_RESTORE;
-           if (neg) {
+#if ST_INO_SIGN == -1
+           if (PL_statcache.st_ino < 0) {
                s.st_ino = (IV)PL_statcache.st_ino;
                if (LIKELY(s.st_ino == PL_statcache.st_ino)) {
                    mPUSHi(s.st_ino);
@@ -3041,7 +3036,9 @@ PP(pp_stat)
                    *--p = '-';
                    mPUSHp(p, buf+sizeof(buf) - p);
                }
-           } else {
+           } else
+#endif
+            {
                s.st_ino = (UV)PL_statcache.st_ino;
                if (LIKELY(s.st_ino == PL_statcache.st_ino)) {
                    mPUSHu(s.st_ino);
diff --git a/regcomp.c b/regcomp.c
index 842094a961..74888ca629 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1701,6 +1701,7 @@ S_ssc_and(pTHX_ const RExC_state_t *pRExC_state, 
regnode_ssc *ssc,
             regnode_charclass_posixl temp;
             int add = 1;    /* To calculate the index of the complement */
 
+            Zero(&temp, 1, regnode_charclass_posixl);
             ANYOF_POSIXL_ZERO(&temp);
             for (i = 0; i < ANYOF_MAX; i++) {
                 assert(i % 2 != 0
@@ -4178,6 +4179,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode 
**scanp,
     PERL_ARGS_ASSERT_STUDY_CHUNK;
     RExC_study_started= 1;
 
+    Zero(&data_fake, 1, scan_data_t);
 
     if ( depth == 0 ) {
         while (first_non_open && OP(first_non_open) == OPEN)
diff --git a/sv.c b/sv.c
index 225a743d14..a5bc1e302b 100644
--- a/sv.c
+++ b/sv.c
@@ -11711,6 +11711,7 @@ S_format_hexfp(pTHX_ char * const buf, const STRLEN 
bufsize, const char c,
              * the top non-zero nybble. */
             for (i = vfnz[0], n = 0; i > 1; i >>= 1, n++) { }
             assert(n < 4);
+            assert(vlnz);
             vlnz[1] = 0;
             for (vshr = vlnz; vshr >= vfnz; vshr--) {
               vshr[1] |= (vshr[0] & (0xF >> (4 - n))) << (4 - n);

-- 
Perl5 Master Repository

Reply via email to