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
4e7457b8
Kaydet (Commit)
4e7457b8
authored
May 09, 2017
tarafından
Xiang Zhang
Kaydeden (comit)
GitHub
May 09, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-29990: Fix range checking in GB18030 decoder (#1509)
üst
228da429
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
test_codecencodings_cn.py
Lib/test/test_codecencodings_cn.py
+6
-0
NEWS
Misc/NEWS
+2
-0
_codecs_cn.c
Modules/cjkcodecs/_codecs_cn.c
+3
-1
No files found.
Lib/test/test_codecencodings_cn.py
Dosyayı görüntüle @
4e7457b8
...
@@ -46,6 +46,12 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
...
@@ -46,6 +46,12 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
(
"abc
\x80\x80\xc1\xc4
"
,
"ignore"
,
u"abc
\u804a
"
),
(
"abc
\x80\x80\xc1\xc4
"
,
"ignore"
,
u"abc
\u804a
"
),
(
"abc
\x84\x39\x84\x39\xc1\xc4
"
,
"replace"
,
u"abc
\ufffd\u804a
"
),
(
"abc
\x84\x39\x84\x39\xc1\xc4
"
,
"replace"
,
u"abc
\ufffd\u804a
"
),
(
u"
\u30fb
"
,
"strict"
,
"
\x81
9
\xa7
9"
),
(
u"
\u30fb
"
,
"strict"
,
"
\x81
9
\xa7
9"
),
# issue29990
(
"
\xff\x30\x81\x30
"
,
"strict"
,
None
),
(
"
\x81\x30\xff\x30
"
,
"strict"
,
None
),
(
"abc
\x81\x39\xff\x39\xc1\xc4
"
,
"replace"
,
u"abc
\ufffd\u804a
"
),
(
"abc
\xab\x36\xff\x30
def"
,
"replace"
,
u'abc
\ufffd
def'
),
(
"abc
\xbf\x38\xff\x32\xc1\xc4
"
,
"ignore"
,
u"abc
\u804a
"
),
)
)
has_iso10646
=
True
has_iso10646
=
True
...
...
Misc/NEWS
Dosyayı görüntüle @
4e7457b8
...
@@ -42,6 +42,8 @@ Extension Modules
...
@@ -42,6 +42,8 @@ Extension Modules
Library
Library
-------
-------
- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma Lin.
- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
Misusing them could cause memory leaks or crashes. Now scanner and encoder
Misusing them could cause memory leaks or crashes. Now scanner and encoder
objects are completely initialized in the __new__ methods.
objects are completely initialized in the __new__ methods.
...
...
Modules/cjkcodecs/_codecs_cn.c
Dosyayı görüntüle @
4e7457b8
...
@@ -266,7 +266,9 @@ DECODER(gb18030)
...
@@ -266,7 +266,9 @@ DECODER(gb18030)
REQUIRE_INBUF
(
4
)
REQUIRE_INBUF
(
4
)
c3
=
IN3
;
c3
=
IN3
;
c4
=
IN4
;
c4
=
IN4
;
if
(
c
<
0x81
||
c3
<
0x81
||
c4
<
0x30
||
c4
>
0x39
)
if
(
c
<
0x81
||
c
>
0xFE
||
c3
<
0x81
||
c3
>
0xFE
||
c4
<
0x30
||
c4
>
0x39
)
return
4
;
return
4
;
c
-=
0x81
;
c2
-=
0x30
;
c
-=
0x81
;
c2
-=
0x30
;
c3
-=
0x81
;
c4
-=
0x30
;
c3
-=
0x81
;
c4
-=
0x30
;
...
...
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