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
d524922b
Kaydet (Commit)
d524922b
authored
Eki 04, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22518: Fixed integer overflow issues in "backslashreplace" and
"xmlcharrefreplace" error handlers.
üst
52313d72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
NEWS
Misc/NEWS
+3
-0
codecs.c
Python/codecs.c
+12
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
d524922b
...
...
@@ -10,6 +10,9 @@ What's New in Python 2.7.9?
Core and Builtins
-----------------
- Issue #22518: Fixed integer overflow issues in "backslashreplace" and
"xmlcharrefreplace" error handlers.
- Issue #22526: Fix iterating through files with lines longer than 2^31 bytes.
- Issue #22519: Fix overflow checking in PyString_Repr.
...
...
Python/codecs.c
Dosyayı görüntüle @
d524922b
...
...
@@ -558,7 +558,7 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc)
Py_UNICODE
*
startp
;
Py_UNICODE
*
e
;
Py_UNICODE
*
outp
;
in
t
ressize
;
Py_ssize_
t
ressize
;
if
(
PyUnicodeEncodeError_GetStart
(
exc
,
&
start
))
return
NULL
;
if
(
PyUnicodeEncodeError_GetEnd
(
exc
,
&
end
))
...
...
@@ -566,6 +566,14 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc)
if
(
!
(
object
=
PyUnicodeEncodeError_GetObject
(
exc
)))
return
NULL
;
startp
=
PyUnicode_AS_UNICODE
(
object
);
if
(
end
-
start
>
PY_SSIZE_T_MAX
/
(
2
+
7
+
1
))
{
end
=
start
+
PY_SSIZE_T_MAX
/
(
2
+
7
+
1
);
#ifndef Py_UNICODE_WIDE
ch
=
startp
[
end
-
1
];
if
(
0xD800
<=
ch
&&
ch
<=
0xDBFF
)
end
--
;
#endif
}
e
=
startp
+
end
;
for
(
p
=
startp
+
start
,
ressize
=
0
;
p
<
e
;)
{
Py_UCS4
ch
=
*
p
++
;
...
...
@@ -675,13 +683,15 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
Py_UNICODE
*
p
;
Py_UNICODE
*
startp
;
Py_UNICODE
*
outp
;
in
t
ressize
;
Py_ssize_
t
ressize
;
if
(
PyUnicodeEncodeError_GetStart
(
exc
,
&
start
))
return
NULL
;
if
(
PyUnicodeEncodeError_GetEnd
(
exc
,
&
end
))
return
NULL
;
if
(
!
(
object
=
PyUnicodeEncodeError_GetObject
(
exc
)))
return
NULL
;
if
(
end
-
start
>
PY_SSIZE_T_MAX
/
(
1
+
1
+
8
))
end
=
start
+
PY_SSIZE_T_MAX
/
(
1
+
1
+
8
);
startp
=
PyUnicode_AS_UNICODE
(
object
);
for
(
p
=
startp
+
start
,
ressize
=
0
;
p
<
startp
+
end
;
++
p
)
{
#ifdef Py_UNICODE_WIDE
...
...
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