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
e359bc24
Kaydet (Commit)
e359bc24
authored
Kas 04, 2018
tarafından
Alexey Izbyshev
Kaydeden (comit)
Serhiy Storchaka
Kas 04, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid}. (GH-10319)
Reported by ASAN.
üst
52465e1b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
grpmodule.c
Modules/grpmodule.c
+4
-2
pwdmodule.c
Modules/pwdmodule.c
+4
-2
No files found.
Modules/grpmodule.c
Dosyayı görüntüle @
e359bc24
...
@@ -124,11 +124,12 @@ grp_getgrgid_impl(PyObject *module, PyObject *id)
...
@@ -124,11 +124,12 @@ grp_getgrgid_impl(PyObject *module, PyObject *id)
Py_DECREF
(
py_int_id
);
Py_DECREF
(
py_int_id
);
}
}
#ifdef HAVE_GETGRGID_R
#ifdef HAVE_GETGRGID_R
Py_BEGIN_ALLOW_THREADS
int
status
;
int
status
;
Py_ssize_t
bufsize
;
Py_ssize_t
bufsize
;
/* Note: 'grp' will be used via pointer 'p' on getgrgid_r success. */
struct
group
grp
;
struct
group
grp
;
Py_BEGIN_ALLOW_THREADS
bufsize
=
sysconf
(
_SC_GETGR_R_SIZE_MAX
);
bufsize
=
sysconf
(
_SC_GETGR_R_SIZE_MAX
);
if
(
bufsize
==
-
1
)
{
if
(
bufsize
==
-
1
)
{
bufsize
=
DEFAULT_BUFFER_SIZE
;
bufsize
=
DEFAULT_BUFFER_SIZE
;
...
@@ -204,11 +205,12 @@ grp_getgrnam_impl(PyObject *module, PyObject *name)
...
@@ -204,11 +205,12 @@ grp_getgrnam_impl(PyObject *module, PyObject *name)
if
(
PyBytes_AsStringAndSize
(
bytes
,
&
name_chars
,
NULL
)
==
-
1
)
if
(
PyBytes_AsStringAndSize
(
bytes
,
&
name_chars
,
NULL
)
==
-
1
)
goto
out
;
goto
out
;
#ifdef HAVE_GETGRNAM_R
#ifdef HAVE_GETGRNAM_R
Py_BEGIN_ALLOW_THREADS
int
status
;
int
status
;
Py_ssize_t
bufsize
;
Py_ssize_t
bufsize
;
/* Note: 'grp' will be used via pointer 'p' on getgrnam_r success. */
struct
group
grp
;
struct
group
grp
;
Py_BEGIN_ALLOW_THREADS
bufsize
=
sysconf
(
_SC_GETGR_R_SIZE_MAX
);
bufsize
=
sysconf
(
_SC_GETGR_R_SIZE_MAX
);
if
(
bufsize
==
-
1
)
{
if
(
bufsize
==
-
1
)
{
bufsize
=
DEFAULT_BUFFER_SIZE
;
bufsize
=
DEFAULT_BUFFER_SIZE
;
...
...
Modules/pwdmodule.c
Dosyayı görüntüle @
e359bc24
...
@@ -131,11 +131,12 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
...
@@ -131,11 +131,12 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
return
NULL
;
return
NULL
;
}
}
#ifdef HAVE_GETPWUID_R
#ifdef HAVE_GETPWUID_R
Py_BEGIN_ALLOW_THREADS
int
status
;
int
status
;
Py_ssize_t
bufsize
;
Py_ssize_t
bufsize
;
/* Note: 'pwd' will be used via pointer 'p' on getpwuid_r success. */
struct
passwd
pwd
;
struct
passwd
pwd
;
Py_BEGIN_ALLOW_THREADS
bufsize
=
sysconf
(
_SC_GETPW_R_SIZE_MAX
);
bufsize
=
sysconf
(
_SC_GETPW_R_SIZE_MAX
);
if
(
bufsize
==
-
1
)
{
if
(
bufsize
==
-
1
)
{
bufsize
=
DEFAULT_BUFFER_SIZE
;
bufsize
=
DEFAULT_BUFFER_SIZE
;
...
@@ -212,11 +213,12 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name)
...
@@ -212,11 +213,12 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name)
if
(
PyBytes_AsStringAndSize
(
bytes
,
&
name_chars
,
NULL
)
==
-
1
)
if
(
PyBytes_AsStringAndSize
(
bytes
,
&
name_chars
,
NULL
)
==
-
1
)
goto
out
;
goto
out
;
#ifdef HAVE_GETPWNAM_R
#ifdef HAVE_GETPWNAM_R
Py_BEGIN_ALLOW_THREADS
int
status
;
int
status
;
Py_ssize_t
bufsize
;
Py_ssize_t
bufsize
;
/* Note: 'pwd' will be used via pointer 'p' on getpwnam_r success. */
struct
passwd
pwd
;
struct
passwd
pwd
;
Py_BEGIN_ALLOW_THREADS
bufsize
=
sysconf
(
_SC_GETPW_R_SIZE_MAX
);
bufsize
=
sysconf
(
_SC_GETPW_R_SIZE_MAX
);
if
(
bufsize
==
-
1
)
{
if
(
bufsize
==
-
1
)
{
bufsize
=
DEFAULT_BUFFER_SIZE
;
bufsize
=
DEFAULT_BUFFER_SIZE
;
...
...
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