In perl.git, the branch maint-5.24 has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/9f1af5a50d2f83c4d120afe5ad40f4775b25b013?hp=5dbc4d4e3afd8d89e9b94ae99874b3172e67f1a7>

- Log -----------------------------------------------------------------
commit 9f1af5a50d2f83c4d120afe5ad40f4775b25b013
Author: Steve Hay <[email protected]>
Date:   Sun Sep 10 15:05:43 2017 +0100

    Finalize perldelta

M       pod/perldelta.pod

commit 8e3611893e41b8448eab2b9994ff770afc8398a3
Author: Steve Hay <[email protected]>
Date:   Sun Sep 10 13:18:50 2017 +0100

    perldelta for 96c83ed78a, 2be4edede4 and 8586647e33
    
    (cherry picked from commit d1107db027ad52d2f50e348218625a8e122ca9eb)

M       pod/perldelta.pod

commit 205f8363fb14aa2b2995fd16da66583bd6b47f4f
Author: Tony Cook <[email protected]>
Date:   Thu Jul 27 10:12:02 2017 +1000

    (perl #131665) avoid a buffer overflow in a buffer we didn't need
    
    since Lookup() treats its argument as NUL or '=' terminated.
    
    Previously environment variable names longer than the size of the
    buffer would result in a buffer overflow.
    
    (cherry picked from commit 8586647e338e8eb42c00fe6f687105c9b8a36d44)

M       t/win32/runenv.t
M       win32/perlhost.h

commit 40b3cdad3649334585cee8f4630ec9a025e62be6
Author: Karl Williamson <[email protected]>
Date:   Fri Aug 25 11:33:58 2017 -0600

    PATCH: [perl #131598]
    
    The cause of this is that the vFAIL macro uses RExC_parse, and that
    variable has just been changed in preparation for code after the vFAIL.
    The solution is to not change RExC_parse until after the vFAIL.
    
    This is a case where the macro hides stuff that can bite you.
    
    (cherry picked from commit 2be4edede4ae226e2eebd4eff28cedd2041f300f)

M       regcomp.c

commit f7e5417e7bffba03947b66e4d8622d7c220f2876
Author: Karl Williamson <[email protected]>
Date:   Wed Jun 21 11:33:37 2017 -0600

    regcomp [perl #131582]
    
    (cherry picked from commit 96c83ed78aeea1a0496dd2b2d935869a822dc8a5)

M       regcomp.c
-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod | 50 ++++++++++++++++++++++++++++++++++++++++++++------
 regcomp.c         |  7 +++++--
 t/win32/runenv.t  | 21 ++++++++++++++++-----
 win32/perlhost.h  | 10 ++--------
 4 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 5afd79ea00..d6bdbacd16 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -14,11 +14,25 @@ L<perl5242delta>, which describes differences between 
5.24.1 and 5.24.2.
 
 =head1 Security
 
-XXX Any security-related notices go here.  In particular, any security
-vulnerabilities closed should be noted here rather than in the
-L</Selected Bug Fixes> section.
+=head2 [CVE-2017-12837] Heap buffer overflow in regular expression compiler
 
-[ List each security issue as a =head2 entry ]
+Compiling certain regular expression patterns with the case-insensitive
+modifier could cause a heap buffer overflow and crash perl.  This has now been
+fixed.
+L<[perl #131582]|https://rt.perl.org/Public/Bug/Display.html?id=131582>
+
+=head2 [CVE-2017-12883] Buffer over-read in regular expression parser
+
+For certain types of syntax error in a regular expression pattern, the error
+message could either contain the contents of a random, possibly large, chunk of
+memory, or could crash perl.  This has now been fixed.
+L<[perl #131598]|https://rt.perl.org/Public/Bug/Display.html?id=131598>
+
+=head2 [CVE-2017-12814] C<$ENV{$key}> stack buffer overflow on Windows
+
+A possible stack buffer overflow in the C<%ENV> code on Windows has been fixed
+by removing the buffer completely since it was superfluous anyway.
+L<[perl #131665]|https://rt.perl.org/Public/Bug/Display.html?id=131665>
 
 =head1 Incompatible Changes
 
@@ -261,9 +275,33 @@ L<[perl 
#131260]|https://rt.perl.org/Public/Bug/Display.html?id=131260>
 
 =head1 Acknowledgements
 
-XXX Generate this with:
+Perl 5.24.3 represents approximately 2 months of development since Perl 5.24.2
+and contains approximately 3,100 lines of changes across 120 files from 20
+authors.
+
+Excluding auto-generated files, documentation and release tools, there were
+approximately 1,500 lines of changes to 56 .pm, .t, .c and .h files.
+
+Perl continues to flourish into its third decade thanks to a vibrant community
+of users and developers.  The following people are known to have contributed
+the improvements that became Perl 5.24.3:
+
+Aaron Crane, Craig A. Berry, Dan Collins, Daniel Dragan, Dave Cross, David
+Mitchell, Eric Herman, Father Chrysostomos, H.Merijn Brand, Hugo van der
+Sanden, James E Keenan, Jarkko Hietaniemi, Karl Williamson, Lukas Mai, Matthew
+Horsfall, Stevan Little, Steve Hay, Steven Humphrey, Tony Cook, Yves Orton.
+
+The list above is almost certainly incomplete as it is automatically generated
+from version control history.  In particular, it does not include the names of
+the (very much appreciated) contributors who reported issues to the Perl bug
+tracker.
+
+Many of the changes included in this version originated in the CPAN modules
+included in Perl's core.  We're grateful to the entire CPAN community for
+helping Perl to flourish.
 
-  perl Porting/acknowledgements.pl v5.24.2..HEAD
+For a more complete list of all of Perl's historical contributors, please see
+the F<AUTHORS> file in the Perl source distribution.
 
 =head1 Reporting Bugs
 
diff --git a/regcomp.c b/regcomp.c
index 43841198aa..c6c7cb4925 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11922,14 +11922,16 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
        }
         sv_catpv(substitute_parse, ")");
 
-        RExC_parse = RExC_start = RExC_adjusted_start = SvPV(substitute_parse,
-                                                             len);
+        len = SvCUR(substitute_parse);
 
        /* Don't allow empty number */
        if (len < (STRLEN) 8) {
             RExC_parse = endbrace;
            vFAIL("Invalid hexadecimal number in \\N{U+...}");
        }
+
+        RExC_parse = RExC_start = RExC_adjusted_start
+                                              = SvPV_nolen(substitute_parse);
        RExC_end = RExC_parse + len;
 
         /* The values are Unicode, and therefore not subject to recoding, but
@@ -13022,6 +13024,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth)
                             goto loopdone;
                         }
                         p = RExC_parse;
+                        RExC_parse = parse_start;
                         if (ender > 0xff) {
                             REQUIRE_UTF8(flagp);
                         }
diff --git a/t/win32/runenv.t b/t/win32/runenv.t
index 0e2b0ca015..ff755563f0 100644
--- a/t/win32/runenv.t
+++ b/t/win32/runenv.t
@@ -14,10 +14,10 @@ BEGIN {
     require Win32;
     ($::os_id, $::os_major) = ( Win32::GetOSVersion() )[ 4, 1 ];
     if ($::os_id == 2 and $::os_major == 6) {    # Vista, Server 2008 (incl 
R2), 7
-       $::tests = 43;
+       $::tests = 45;
     }
     else {
-       $::tests = 40;
+       $::tests = 42;
     }
 
     require './test.pl';
@@ -70,11 +70,12 @@ sub runperl_and_capture {
 }
 
 sub try {
-  my ($env, $args, $stdout, $stderr) = @_;
+  my ($env, $args, $stdout, $stderr, $name) = @_;
   my ($actual_stdout, $actual_stderr) = runperl_and_capture($env, $args);
+  $name ||= "";
   local $::Level = $::Level + 1;
-  is $actual_stdout, $stdout;
-  is $actual_stderr, $stderr;
+  is $actual_stdout, $stdout, "$name - stdout";
+  is $actual_stderr, $stderr, "$name - stderr";
 }
 
 #  PERL5OPT    Command-line options (switches).  Switches in
@@ -196,6 +197,16 @@ try({PERL5LIB => "foo",
     '',
     '');
 
+{
+    # 131665
+    # crashes without the fix
+    my $longname = "X" x 2048;
+    try({ $longname => 1 },
+        [ '-e', '"print q/ok/"' ],
+        'ok', '',
+        'very long env var names' );
+}
+
 # Tests for S_incpush_use_sep():
 
 my @dump_inc = ('-e', '"print \"$_\n\" foreach @INC"');
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 9963319a92..2ef773ee0e 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -2177,17 +2177,11 @@ compare(const void *arg1, const void *arg2)
 void
 CPerlHost::Add(LPCSTR lpStr)
 {
-    char szBuffer[1024];
     LPSTR *lpPtr;
-    int index, length = strlen(lpStr)+1;
-
-    for(index = 0; lpStr[index] != '\0' && lpStr[index] != '='; ++index)
-       szBuffer[index] = lpStr[index];
-
-    szBuffer[index] = '\0';
+    STRLEN length = strlen(lpStr)+1;
 
     // replacing ?
-    lpPtr = Lookup(szBuffer);
+    lpPtr = Lookup(lpStr);
     if (lpPtr != NULL) {
        // must allocate things via host memory allocation functions 
        // rather than perl's Renew() et al, as the perl interpreter

--
Perl5 Master Repository

Reply via email to