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
644bef79
Kaydet (Commit)
644bef79
authored
Tem 04, 2010
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9128: Fix validation of class decorators in parser module.
üst
e9123efa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
test_parser.py
Lib/test/test_parser.py
+8
-0
NEWS
Misc/NEWS
+2
-0
parsermodule.c
Modules/parsermodule.c
+9
-8
No files found.
Lib/test/test_parser.py
Dosyayı görüntüle @
644bef79
...
@@ -156,6 +156,14 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
...
@@ -156,6 +156,14 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def
test_class_defs
(
self
):
def
test_class_defs
(
self
):
self
.
check_suite
(
"class foo():pass"
)
self
.
check_suite
(
"class foo():pass"
)
self
.
check_suite
(
"@class_decorator
\n
"
"class foo():pass"
)
self
.
check_suite
(
"@class_decorator(arg)
\n
"
"class foo():pass"
)
self
.
check_suite
(
"@decorator1
\n
"
"@decorator2
\n
"
"class foo():pass"
)
def
test_import_from_statement
(
self
):
def
test_import_from_statement
(
self
):
self
.
check_suite
(
"from sys.path import *"
)
self
.
check_suite
(
"from sys.path import *"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
644bef79
...
@@ -81,6 +81,8 @@ C-API
...
@@ -81,6 +81,8 @@ C-API
Library
Library
-------
-------
- Issue #9128: Fix validation of class decorators in parser module.
- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop
- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop
module, ensure that the input string length is a multiple of the frame size
module, ensure that the input string length is a multiple of the frame size
...
...
Modules/parsermodule.c
Dosyayı görüntüle @
644bef79
...
@@ -2679,14 +2679,15 @@ validate_funcdef(node *tree)
...
@@ -2679,14 +2679,15 @@ validate_funcdef(node *tree)
static
int
static
int
validate_decorated
(
node
*
tree
)
validate_decorated
(
node
*
tree
)
{
{
int
nch
=
NCH
(
tree
);
int
nch
=
NCH
(
tree
);
int
ok
=
(
validate_ntype
(
tree
,
decorated
)
int
ok
=
(
validate_ntype
(
tree
,
decorated
)
&&
(
nch
==
2
)
&&
(
nch
==
2
)
&&
validate_decorators
(
RCHILD
(
tree
,
-
2
))
&&
validate_decorators
(
RCHILD
(
tree
,
-
2
)));
&&
(
validate_funcdef
(
RCHILD
(
tree
,
-
1
))
if
(
TYPE
(
RCHILD
(
tree
,
-
1
))
==
funcdef
)
||
validate_class
(
RCHILD
(
tree
,
-
1
)))
ok
=
ok
&&
validate_funcdef
(
RCHILD
(
tree
,
-
1
));
);
else
return
ok
;
ok
=
ok
&&
validate_class
(
RCHILD
(
tree
,
-
1
));
return
ok
;
}
}
static
int
static
int
...
...
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