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
b1ed7fac
Kaydet (Commit)
b1ed7fac
authored
Nis 13, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace INT_MAX with PY_SSIZE_T_MAX.
üst
2a19074a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
12 deletions
+11
-12
functionalmodule.c
Modules/functionalmodule.c
+1
-1
listobject.c
Objects/listobject.c
+2
-2
bltinmodule.c
Python/bltinmodule.c
+2
-3
codecs.c
Python/codecs.c
+5
-5
modsupport.c
Python/modsupport.c
+1
-1
No files found.
Modules/functionalmodule.c
Dosyayı görüntüle @
b1ed7fac
...
@@ -48,7 +48,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
...
@@ -48,7 +48,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
pto
->
fn
=
func
;
pto
->
fn
=
func
;
Py_INCREF
(
func
);
Py_INCREF
(
func
);
pto
->
args
=
PyTuple_GetSlice
(
args
,
1
,
IN
T_MAX
);
pto
->
args
=
PyTuple_GetSlice
(
args
,
1
,
PY_SSIZE_
T_MAX
);
if
(
pto
->
args
==
NULL
)
{
if
(
pto
->
args
==
NULL
)
{
pto
->
kw
=
NULL
;
pto
->
kw
=
NULL
;
Py_DECREF
(
pto
);
Py_DECREF
(
pto
);
...
...
Objects/listobject.c
Dosyayı görüntüle @
b1ed7fac
...
@@ -181,7 +181,7 @@ ins1(PyListObject *self, Py_ssize_t where, PyObject *v)
...
@@ -181,7 +181,7 @@ ins1(PyListObject *self, Py_ssize_t where, PyObject *v)
PyErr_BadInternalCall
();
PyErr_BadInternalCall
();
return
-
1
;
return
-
1
;
}
}
if
(
n
==
IN
T_MAX
)
{
if
(
n
==
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"cannot add more objects to list"
);
"cannot add more objects to list"
);
return
-
1
;
return
-
1
;
...
@@ -221,7 +221,7 @@ app1(PyListObject *self, PyObject *v)
...
@@ -221,7 +221,7 @@ app1(PyListObject *self, PyObject *v)
Py_ssize_t
n
=
PyList_GET_SIZE
(
self
);
Py_ssize_t
n
=
PyList_GET_SIZE
(
self
);
assert
(
v
!=
NULL
);
assert
(
v
!=
NULL
);
if
(
n
==
IN
T_MAX
)
{
if
(
n
==
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"cannot add more objects to list"
);
"cannot add more objects to list"
);
return
-
1
;
return
-
1
;
...
...
Python/bltinmodule.c
Dosyayı görüntüle @
b1ed7fac
...
@@ -1746,14 +1746,13 @@ builtin_raw_input(PyObject *self, PyObject *args)
...
@@ -1746,14 +1746,13 @@ builtin_raw_input(PyObject *self, PyObject *args)
}
}
else
{
/* strip trailing '\n' */
else
{
/* strip trailing '\n' */
size_t
len
=
strlen
(
s
);
size_t
len
=
strlen
(
s
);
if
(
len
>
IN
T_MAX
)
{
if
(
len
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"[raw_]input: input too long"
);
"[raw_]input: input too long"
);
result
=
NULL
;
result
=
NULL
;
}
}
else
{
else
{
result
=
PyString_FromStringAndSize
(
s
,
result
=
PyString_FromStringAndSize
(
s
,
len
-
1
);
(
int
)(
len
-
1
));
}
}
}
}
PyMem_FREE
(
s
);
PyMem_FREE
(
s
);
...
...
Python/codecs.c
Dosyayı görüntüle @
b1ed7fac
...
@@ -56,12 +56,12 @@ PyObject *normalizestring(const char *string)
...
@@ -56,12 +56,12 @@ PyObject *normalizestring(const char *string)
char
*
p
;
char
*
p
;
PyObject
*
v
;
PyObject
*
v
;
if
(
len
>
IN
T_MAX
)
{
if
(
len
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too large"
);
PyErr_SetString
(
PyExc_OverflowError
,
"string is too large"
);
return
NULL
;
return
NULL
;
}
}
v
=
PyString_FromStringAndSize
(
NULL
,
(
int
)
len
);
v
=
PyString_FromStringAndSize
(
NULL
,
len
);
if
(
v
==
NULL
)
if
(
v
==
NULL
)
return
NULL
;
return
NULL
;
p
=
PyString_AS_STRING
(
v
);
p
=
PyString_AS_STRING
(
v
);
...
...
Python/modsupport.c
Dosyayı görüntüle @
b1ed7fac
...
@@ -407,7 +407,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
...
@@ -407,7 +407,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
else
{
else
{
if
(
n
<
0
)
{
if
(
n
<
0
)
{
size_t
m
=
strlen
(
str
);
size_t
m
=
strlen
(
str
);
if
(
m
>
IN
T_MAX
)
{
if
(
m
>
PY_SSIZE_
T_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
PyErr_SetString
(
PyExc_OverflowError
,
"string too long for Python string"
);
"string too long for Python string"
);
return
NULL
;
return
NULL
;
...
...
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