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
7a4da324
Kaydet (Commit)
7a4da324
authored
Ock 10, 2017
tarafından
Xiang Zhang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #29145: Merge 3.6.
üst
9ebb245d
95403d74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
transmogrify.h
Objects/stringlib/transmogrify.h
+1
-1
unicodeobject.c
Objects/unicodeobject.c
+8
-6
No files found.
Objects/stringlib/transmogrify.h
Dosyayı görüntüle @
7a4da324
...
...
@@ -261,7 +261,7 @@ stringlib_replace_interleave(PyObject *self,
assert
(
count
>
0
);
if
(
to_len
>
(
PY_SSIZE_T_MAX
-
self_len
)
/
count
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"replace bytes
are
too long"
);
"replace bytes
is
too long"
);
return
NULL
;
}
result_len
=
count
*
to_len
+
self_len
;
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
7a4da324
...
...
@@ -9950,7 +9950,7 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject **items, Py_ssize_t seqlen)
use_memcpy = 1;
#endif
for (i = 0; i < seqlen; i++) {
const Py_ssize_t old_sz =
sz;
size_t add_
sz;
item = items[i];
if (!PyUnicode_Check(item)) {
PyErr_Format(PyExc_TypeError,
...
...
@@ -9961,16 +9961,18 @@ _PyUnicode_JoinArray(PyObject *separator, PyObject **items, Py_ssize_t seqlen)
}
if (PyUnicode_READY(item) == -1)
goto onError;
sz +
= PyUnicode_GET_LENGTH(item);
add_sz
= PyUnicode_GET_LENGTH(item);
item_maxchar = PyUnicode_MAX_CHAR_VALUE(item);
maxchar = Py_MAX(maxchar, item_maxchar);
if (i != 0)
sz += seplen;
if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
if (i != 0) {
add_sz += seplen;
}
if (add_sz > (size_t)(PY_SSIZE_T_MAX - sz)) {
PyErr_SetString(PyExc_OverflowError,
"join() result is too long for a Python string");
goto onError;
}
sz += add_sz;
if (use_memcpy && last_obj != NULL) {
if (PyUnicode_KIND(last_obj) != PyUnicode_KIND(item))
use_memcpy = 0;
...
...
@@ -10608,7 +10610,7 @@ replace(PyObject *self, PyObject *str1,
u = unicode_empty;
goto done;
}
if (new_size > (PY_SSIZE_T_MAX
>> (rkind-1)
)) {
if (new_size > (PY_SSIZE_T_MAX
/ rkind
)) {
PyErr_SetString(PyExc_OverflowError,
"replace string is too long");
goto error;
...
...
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