In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bb28541cab043f21bfdd605beef0b98db949105b?hp=ffb73d652a484e55333d3bfab58687234ac784fb>

- Log -----------------------------------------------------------------
commit bb28541cab043f21bfdd605beef0b98db949105b
Author: Father Chrysostomos <[email protected]>
Date:   Wed Mar 7 16:36:54 2012 -0800

    Dear perlvar: ${^WARNING_BITS} was added in 5.6

M       pod/perlvar.pod

commit 44567c868fc64f460c96da246965d0089fbe4773
Author: Father Chrysostomos <[email protected]>
Date:   Wed Mar 7 16:36:07 2012 -0800

    perlvar: Document ${^WARNING_BITS} better
    
    Don’t refer people to warnings.pm for more information, as it
    contains no more information about this variable.
    
    Explain the scoping and also mention that the values are
    considered internal.

M       pod/perlvar.pod

commit 5af88345d9b73adc26765854070a07f429ae112d
Author: Father Chrysostomos <[email protected]>
Date:   Wed Mar 7 14:12:08 2012 -0800

    Stop warning hint-checking from doing bad reads
    
    Setting ${^WARNING_BITS} should not allow perl to read past the end of
    a mallocked buffer.  Previously the internal warning buffer would be
    copied straight from ${^WARNING_BITS}, so a short value assigned to
    that variable would cause the internal warning-checking code to read
    past the end of the buffer (probably not in actual practice, due to
    malloc’s rounding up, but theoretically).  Now, the buffer that is
    allocated for storing the warning bits is padded with nulls to make it
    long enough to prevent bad reads.
    
    The stored length is still the same as what was assigned to
    ${^WARNING_BITS}, so that the value that comes out of it is the same
    length (UTF8-ness aside)--not that it makes much difference in prac-
    tice though, since only warnings.pm should care about this.
    
    This came up as part of perl #111500.

M       util.c

commit eef6290d07de3f52b42c2570878665af9511bcf8
Author: Father Chrysostomos <[email protected]>
Date:   Thu Mar 1 20:28:20 2012 -0800

    Porting/bisect.pl: Typos in diag msg

M       Porting/bisect.pl
-----------------------------------------------------------------------

Summary of changes:
 Porting/bisect.pl |    2 +-
 pod/perlvar.pod   |    6 ++++--
 util.c            |    5 ++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Porting/bisect.pl b/Porting/bisect.pl
index da19721..29e3ded 100755
--- a/Porting/bisect.pl
+++ b/Porting/bisect.pl
@@ -44,7 +44,7 @@ my @stable = qw(perl-5.005 perl-5.6.0 perl-5.8.0 v5.10.0 
v5.12.0 v5.14.0);
     my ($dev_c, $ino_c) = stat 'configure';
     if (defined $dev_C && defined $dev_c
         && $dev_C == $dev_c && $ino_C == $ino_c) {
-        print "You seem to to be on a case insensitive file system.\n\n";
+        print "You seem to be on a case-insensitive file system.\n\n";
     } else {
         unshift @stable, qw(perl-5.002 perl-5.003 perl-5.004)
     }
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 3ae354c..ed4b370 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -1622,9 +1622,11 @@ Mnemonic: related to the B<-w> switch.
 X<${^WARNING_BITS}>
 
 The current set of warning checks enabled by the C<use warnings> pragma.
-See the documentation of C<warnings> for more details.
+It has the same scoping as the C<$^H> and C<%^H> variables.  The exact
+values are considered internal to the L<warnings> pragma and may change
+between versions of Perl.
 
-This variable was added in Perl 5.10.
+This variable was added in Perl 5.6.
 
 =item $OS_ERROR
 
diff --git a/util.c b/util.c
index 1ff5913..e6b5fa5 100644
--- a/util.c
+++ b/util.c
@@ -2002,7 +2002,8 @@ S_ckwarn_common(pTHX_ U32 w)
 STRLEN *
 Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const char *const bits,
                           STRLEN size) {
-    const MEM_SIZE len_wanted = sizeof(STRLEN) + size;
+    const MEM_SIZE len_wanted =
+       sizeof(STRLEN) + (size > WARNsize ? size : WARNsize);
     PERL_UNUSED_CONTEXT;
     PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD;
 
@@ -2012,6 +2013,8 @@ Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const 
char *const bits,
         PerlMemShared_realloc(buffer, len_wanted));
     buffer[0] = size;
     Copy(bits, (buffer + 1), size, char);
+    if (size < WARNsize)
+       Zero((char *)(buffer + 1) + size, WARNsize - size, char);
     return buffer;
 }
 

--
Perl5 Master Repository

Reply via email to