Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
86e42376
Kaydet (Commit)
86e42376
authored
Şub 04, 2017
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object. Based on patch by WGH.
üst
75c0d4f6
7e10dbbd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
test_re.py
Lib/test/test_re.py
+10
-0
NEWS
Misc/NEWS
+3
-0
_sre.c
Modules/_sre.c
+7
-2
No files found.
Lib/test/test_re.py
Dosyayı görüntüle @
86e42376
...
@@ -1824,6 +1824,16 @@ SUBPATTERN None 0 0
...
@@ -1824,6 +1824,16 @@ SUBPATTERN None 0 0
warnings
.
simplefilter
(
'error'
,
BytesWarning
)
warnings
.
simplefilter
(
'error'
,
BytesWarning
)
self
.
assertNotEqual
(
pattern3
,
pattern1
)
self
.
assertNotEqual
(
pattern3
,
pattern1
)
def
test_bug_29444
(
self
):
s
=
bytearray
(
b
'abcdefgh'
)
m
=
re
.
search
(
b
'[a-h]+'
,
s
)
m2
=
re
.
search
(
b
'[e-h]+'
,
s
)
self
.
assertEqual
(
m
.
group
(),
b
'abcdefgh'
)
self
.
assertEqual
(
m2
.
group
(),
b
'efgh'
)
s
[:]
=
b
'xyz'
self
.
assertEqual
(
m
.
group
(),
b
'xyz'
)
self
.
assertEqual
(
m2
.
group
(),
b
''
)
class
PatternReprTests
(
unittest
.
TestCase
):
class
PatternReprTests
(
unittest
.
TestCase
):
def
check
(
self
,
pattern
,
expected
):
def
check
(
self
,
pattern
,
expected
):
...
...
Misc/NEWS
Dosyayı görüntüle @
86e42376
...
@@ -55,6 +55,9 @@ Extension Modules
...
@@ -55,6 +55,9 @@ Extension Modules
Library
Library
-------
-------
- Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object. Based on patch by WGH.
- Issue #29335: Fix subprocess.Popen.wait() when the child process has
- Issue #29335: Fix subprocess.Popen.wait() when the child process has
exited to a stopped instead of terminated state (ex: when under ptrace).
exited to a stopped instead of terminated state (ex: when under ptrace).
...
...
Modules/_sre.c
Dosyayı görüntüle @
86e42376
...
@@ -2003,6 +2003,7 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
...
@@ -2003,6 +2003,7 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
Py_buffer
view
;
Py_buffer
view
;
PyObject
*
result
;
PyObject
*
result
;
void
*
ptr
;
void
*
ptr
;
Py_ssize_t
i
,
j
;
if
(
index
<
0
||
index
>=
self
->
groups
)
{
if
(
index
<
0
||
index
>=
self
->
groups
)
{
/* raise IndexError if we were given a bad group number */
/* raise IndexError if we were given a bad group number */
...
@@ -2024,8 +2025,12 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
...
@@ -2024,8 +2025,12 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
ptr
=
getstring
(
self
->
string
,
&
length
,
&
isbytes
,
&
charsize
,
&
view
);
ptr
=
getstring
(
self
->
string
,
&
length
,
&
isbytes
,
&
charsize
,
&
view
);
if
(
ptr
==
NULL
)
if
(
ptr
==
NULL
)
return
NULL
;
return
NULL
;
result
=
getslice
(
isbytes
,
ptr
,
self
->
string
,
self
->
mark
[
index
],
self
->
mark
[
index
+
1
]);
i
=
self
->
mark
[
index
];
j
=
self
->
mark
[
index
+
1
];
i
=
Py_MIN
(
i
,
length
);
j
=
Py_MIN
(
j
,
length
);
result
=
getslice
(
isbytes
,
ptr
,
self
->
string
,
i
,
j
);
if
(
isbytes
&&
view
.
buf
!=
NULL
)
if
(
isbytes
&&
view
.
buf
!=
NULL
)
PyBuffer_Release
(
&
view
);
PyBuffer_Release
(
&
view
);
return
result
;
return
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment