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
582acece
Kaydet (Commit)
582acece
authored
Haz 28, 2000
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Trent Mick's Win64 changes: size_t vs. int or long; also some overflow
tests.
üst
6f2a5efe
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
40 additions
and
21 deletions
+40
-21
ceval.c
Python/ceval.c
+1
-1
codecs.c
Python/codecs.c
+7
-2
compile.c
Python/compile.c
+12
-8
dynload_win.c
Python/dynload_win.c
+1
-1
getcwd.c
Python/getcwd.c
+1
-1
modsupport.c
Python/modsupport.c
+9
-2
sysmodule.c
Python/sysmodule.c
+1
-1
thread_nt.h
Python/thread_nt.h
+5
-2
traceback.c
Python/traceback.c
+3
-3
No files found.
Python/ceval.c
Dosyayı görüntüle @
582acece
...
...
@@ -2876,7 +2876,7 @@ exec_statement(f, prog, globals, locals)
}
else
{
char
*
s
=
PyString_AsString
(
prog
);
if
(
(
int
)
strlen
(
s
)
!=
PyString_Size
(
prog
))
{
if
(
strlen
(
s
)
!=
(
size_t
)
PyString_Size
(
prog
))
{
PyErr_SetString
(
PyExc_ValueError
,
"embedded '
\\
0' in exec string"
);
return
-
1
;
...
...
Python/codecs.c
Dosyayı görüntüle @
582acece
...
...
@@ -83,11 +83,16 @@ static
PyObject
*
normalizestring
(
const
char
*
string
)
{
register
int
i
;
in
t
len
=
strlen
(
string
);
size_
t
len
=
strlen
(
string
);
char
*
p
;
PyObject
*
v
;
v
=
PyString_FromStringAndSize
(
NULL
,
len
);
if
(
len
>
INT_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too large"
);
return
NULL
;
}
v
=
PyString_FromStringAndSize
(
NULL
,
(
int
)
len
);
if
(
v
==
NULL
)
return
NULL
;
p
=
PyString_AS_STRING
(
v
);
...
...
Python/compile.c
Dosyayı görüntüle @
582acece
...
...
@@ -265,8 +265,8 @@ PyCode_New(argcount, nlocals, stacksize, flags,
if
(
!
PyString_Check
(
v
))
continue
;
p
=
PyString_AsString
(
v
);
if
(
(
int
)
strspn
(
p
,
NAME_CHARS
)
!=
PyString_Size
(
v
))
if
(
strspn
(
p
,
NAME_CHARS
)
!=
(
size_t
)
PyString_Size
(
v
))
continue
;
PyString_InternInPlace
(
&
PyTuple_GET_ITEM
(
consts
,
i
));
}
...
...
@@ -340,7 +340,7 @@ com_error(c, exc, msg)
PyObject
*
exc
;
char
*
msg
;
{
in
t
n
=
strlen
(
msg
);
size_
t
n
=
strlen
(
msg
);
PyObject
*
v
;
char
buffer
[
30
];
char
*
s
;
...
...
@@ -720,12 +720,12 @@ com_mangle(c, name, buffer, maxlen)
struct
compiling
*
c
;
char
*
name
;
char
*
buffer
;
in
t
maxlen
;
size_
t
maxlen
;
{
/* Name mangling: __private becomes _classname__private.
This is independent from how the name is used. */
char
*
p
;
in
t
nlen
,
plen
;
size_
t
nlen
,
plen
;
nlen
=
strlen
(
name
);
if
(
nlen
+
2
>=
maxlen
)
return
0
;
/* Don't mangle __extremely_long_names */
...
...
@@ -761,7 +761,7 @@ com_addopnamestr(c, op, name)
char
buffer
[
256
];
if
(
name
!=
NULL
&&
name
[
0
]
==
'_'
&&
name
[
1
]
==
'_'
&&
c
->
c_private
!=
NULL
&&
com_mangle
(
c
,
name
,
buffer
,
(
int
)
sizeof
(
buffer
)))
com_mangle
(
c
,
name
,
buffer
,
sizeof
(
buffer
)))
name
=
buffer
;
#endif
if
(
name
==
NULL
||
(
v
=
PyString_InternFromString
(
name
))
==
NULL
)
{
...
...
@@ -883,7 +883,7 @@ parsestr(s)
char
*
s
;
{
PyObject
*
v
;
in
t
len
;
size_
t
len
;
char
*
buf
;
char
*
p
;
char
*
end
;
...
...
@@ -908,6 +908,10 @@ parsestr(s)
}
s
++
;
len
=
strlen
(
s
);
if
(
len
>
INT_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string to parse is too long"
);
return
NULL
;
}
if
(
s
[
--
len
]
!=
quote
)
{
PyErr_BadInternalCall
();
return
NULL
;
...
...
@@ -2201,7 +2205,7 @@ com_global_stmt(c, n)
char
buffer
[
256
];
if
(
s
!=
NULL
&&
s
[
0
]
==
'_'
&&
s
[
1
]
==
'_'
&&
c
->
c_private
!=
NULL
&&
com_mangle
(
c
,
s
,
buffer
,
(
int
)
sizeof
(
buffer
)))
com_mangle
(
c
,
s
,
buffer
,
sizeof
(
buffer
)))
s
=
buffer
;
#endif
if
(
PyDict_GetItemString
(
c
->
c_locals
,
s
)
!=
NULL
)
{
...
...
Python/dynload_win.c
Dosyayı görüntüle @
582acece
...
...
@@ -104,7 +104,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
"DLL load failed with error code %d"
,
errorCode
);
}
else
{
in
t
len
;
size_
t
len
;
/* For some reason a \r\n
is appended to the text */
if
(
theLength
>=
2
&&
...
...
Python/getcwd.c
Dosyayı görüntüle @
582acece
...
...
@@ -62,7 +62,7 @@ getcwd(buf, size)
return
NULL
;
}
ret
=
getwd
(
localbuf
);
if
(
ret
!=
NULL
&&
strlen
(
localbuf
)
>=
size
)
{
if
(
ret
!=
NULL
&&
strlen
(
localbuf
)
>=
(
size_t
)
size
)
{
errno
=
ERANGE
;
return
NULL
;
}
...
...
Python/modsupport.c
Dosyayı görüntüle @
582acece
...
...
@@ -355,8 +355,15 @@ do_mkvalue(p_format, p_va)
Py_INCREF
(
v
);
}
else
{
if
(
n
<
0
)
n
=
strlen
(
str
);
if
(
n
<
0
)
{
size_t
m
=
strlen
(
str
);
if
(
m
>
INT_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string too long for Python string"
);
return
NULL
;
}
n
=
(
int
)
m
;
}
v
=
PyString_FromStringAndSize
(
str
,
n
);
}
return
v
;
...
...
Python/sysmodule.c
Dosyayı görüntüle @
582acece
...
...
@@ -504,7 +504,7 @@ _PySys_Init()
Py_XDECREF
(
v
);
#ifdef MS_COREDLL
PyDict_SetItemString
(
sysdict
,
"dllhandle"
,
v
=
Py
Int_FromLong
((
int
)
PyWin_DLLhModule
));
v
=
Py
Long_FromVoidPtr
(
PyWin_DLLhModule
));
Py_XDECREF
(
v
);
PyDict_SetItemString
(
sysdict
,
"winver"
,
v
=
PyString_FromString
(
PyWin_DLLVersionString
));
...
...
Python/thread_nt.h
Dosyayı görüntüle @
582acece
...
...
@@ -101,6 +101,9 @@ BOOL InitializeNonRecursiveMutex(PNRMUTEX mutex)
return
mutex
->
hevent
!=
NULL
;
/* TRUE if the mutex is created */
}
#ifdef InterlockedCompareExchange
#undef InterlockedCompareExchange
#endif
#define InterlockedCompareExchange(dest,exchange,comperand) (ixchg((dest), (exchange), (comperand)))
VOID
DeleteNonRecursiveMutex
(
PNRMUTEX
mutex
)
...
...
@@ -179,7 +182,7 @@ static void PyThread__init_thread(void)
*/
int
PyThread_start_new_thread
(
void
(
*
func
)(
void
*
),
void
*
arg
)
{
long
rv
;
INT_PTR
rv
;
int
success
=
0
;
dprintf
((
"%ld: PyThread_start_new_thread called
\n
"
,
PyThread_get_thread_ident
()));
...
...
@@ -190,7 +193,7 @@ int PyThread_start_new_thread(void (*func)(void *), void *arg)
if
(
rv
!=
-
1
)
{
success
=
1
;
dprintf
((
"%ld: PyThread_start_new_thread succeeded: %
ld
\n
"
,
PyThread_get_thread_ident
(),
rv
));
dprintf
((
"%ld: PyThread_start_new_thread succeeded: %
p
\n
"
,
PyThread_get_thread_ident
(),
rv
));
}
return
success
;
...
...
Python/traceback.c
Dosyayı görüntüle @
582acece
...
...
@@ -166,7 +166,7 @@ tb_displayline(f, filename, lineno, name)
path
=
PySys_GetObject
(
"path"
);
if
(
path
!=
NULL
&&
PyList_Check
(
path
))
{
int
npath
=
PyList_Size
(
path
);
in
t
taillen
=
strlen
(
tail
);
size_
t
taillen
=
strlen
(
tail
);
char
namebuf
[
MAXPATHLEN
+
1
];
for
(
i
=
0
;
i
<
npath
;
i
++
)
{
PyObject
*
v
=
PyList_GetItem
(
path
,
i
);
...
...
@@ -175,12 +175,12 @@ tb_displayline(f, filename, lineno, name)
break
;
}
if
(
PyString_Check
(
v
))
{
in
t
len
;
size_
t
len
;
len
=
PyString_Size
(
v
);
if
(
len
+
1
+
taillen
>=
MAXPATHLEN
)
continue
;
/* Too long */
strcpy
(
namebuf
,
PyString_AsString
(
v
));
if
(
(
int
)
strlen
(
namebuf
)
!=
len
)
if
(
strlen
(
namebuf
)
!=
len
)
continue
;
/* v contains '\0' */
if
(
len
>
0
&&
namebuf
[
len
-
1
]
!=
SEP
)
namebuf
[
len
++
]
=
SEP
;
...
...
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