|
1 # |
|
2 # CVE-2011-2728 |
|
3 # http://perl5.git.perl.org/perl.git/commit/1af4051e077438976a4c12a0622feaf6715bec77 |
|
4 # https://bugzilla.redhat.com/show_bug.cgi?id=742236 |
|
5 # |
|
6 diff -urN perl-5.12.3/ext/File-Glob/Glob.xs p/ext/File-Glob/Glob.xs |
|
7 --- perl-5.12.3/ext/File-Glob/Glob.xs 2011-01-09 12:20:55.000000000 -0800 |
|
8 +++ perl-5.12.3/ext/File-Glob/Glob.xs 2011-11-28 00:46:10.593556922 -0800 |
|
9 @@ -1,6 +1,7 @@ |
|
10 #include "EXTERN.h" |
|
11 #include "perl.h" |
|
12 #include "XSUB.h" |
|
13 +#include "strings.h" |
|
14 |
|
15 #include "bsd_glob.h" |
|
16 |
|
17 @@ -49,9 +50,12 @@ |
|
18 /* allow for optional flags argument */ |
|
19 if (items > 1) { |
|
20 flags = (int) SvIV(ST(1)); |
|
21 + /* remove unsupported flags */ |
|
22 + flags &= ~(GLOB_APPEND | GLOB_DOOFFS | GLOB_ALTDIRFUNC | GLOB_MAGCHAR); |
|
23 } |
|
24 |
|
25 /* call glob */ |
|
26 + bzero(&pglob, sizeof(glob_t)); |
|
27 retval = bsd_glob(pattern, flags, errfunc, &pglob); |
|
28 GLOB_ERROR = retval; |
|
29 |
|
30 --- perl-5.12.3/ext/File-Glob/t/basic.t.orig út lis 15 13:22:27 2011 |
|
31 +++ perl-5.12.3/ext/File-Glob/t/basic.t út lis 15 13:22:54 2011 |
|
32 @@ -15,7 +15,7 @@ |
|
33 } |
|
34 } |
|
35 use strict; |
|
36 -use Test::More tests => 14; |
|
37 +use Test::More tests => 15; |
|
38 BEGIN {use_ok('File::Glob', ':glob')}; |
|
39 use Cwd (); |
|
40 |
|
41 @@ -195,3 +195,7 @@ |
|
42 local $TODO = "home-made glob doesn't do regexes" if $^O eq 'VMS'; |
|
43 is_deeply(\@glob_files, ['a_dej']); |
|
44 } |
|
45 + |
|
46 +# This used to segfault. |
|
47 +my $i = bsd_glob('*', GLOB_ALTDIRFUNC); |
|
48 +is(&File::Glob::GLOB_ERROR, 0, "Successfuly ignored unsupported flag"); |
|
49 --- perl-5.12.3/patchlevel.h.orig út lis 15 13:26:11 2011 |
|
50 +++ perl-5.12.3/patchlevel.h út lis 15 13:26:17 2011 |
|
51 @@ -131,6 +131,7 @@ |
|
52 ,"uncommitted-changes" |
|
53 #endif |
|
54 PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ |
|
55 + ,"7111771 Problem with utility/perl" |
|
56 ,NULL |
|
57 }; |