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
e8db861f
Kaydet (Commit)
e8db861f
authored
Tem 25, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27581: Don’t rely on overflow wrapping in PySequence_Tuple()
Patch by Xiang Zhang.
üst
aa46bd46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
NEWS
Misc/NEWS
+3
-0
abstract.c
Objects/abstract.c
+5
-4
No files found.
Misc/NEWS
Dosyayı görüntüle @
e8db861f
...
...
@@ -25,6 +25,9 @@ Core and Builtins
- Issue #27507: Add integer overflow check in bytearray.extend(). Patch by
Xiang Zhang.
- Issue #27581: Don'
t
rely
on
wrapping
for
overflow
check
in
PySequence_Tuple
().
Patch
by
Xiang
Zhang
.
-
Issue
#
27443
:
__length_hint__
()
of
bytearray
iterators
no
longer
return
a
negative
integer
for
a
resized
bytearray
.
...
...
Objects/abstract.c
Dosyayı görüntüle @
e8db861f
...
...
@@ -1724,21 +1724,22 @@ PySequence_Tuple(PyObject *v)
break
;
}
if
(
j
>=
n
)
{
Py_ssize_t
oldn
=
n
;
size_t
newn
=
(
size_t
)
n
;
/* The over-allocation strategy can grow a bit faster
than for lists because unlike lists the
over-allocation isn't permanent -- we reclaim
the excess before the end of this routine.
So, grow by ten and then add 25%.
*/
n
+=
10
;
n
+=
n
>>
2
;
if
(
n
<
oldn
)
{
n
ewn
+=
10u
;
n
ewn
+=
new
n
>>
2
;
if
(
n
ewn
>
PY_SSIZE_T_MAX
)
{
/* Check for overflow */
PyErr_NoMemory
();
Py_DECREF
(
item
);
goto
Fail
;
}
n
=
(
Py_ssize_t
)
newn
;
if
(
_PyTuple_Resize
(
&
result
,
n
)
!=
0
)
{
Py_DECREF
(
item
);
goto
Fail
;
...
...
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