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
cb970730
Kaydet (Commit)
cb970730
authored
Haz 19, 2018
tarafından
Pablo Galindo
Kaydeden (comit)
Serhiy Storchaka
Haz 19, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33630: Fix using of freed memory in old versions of glicb for posix_spawn(). (GH-7685)
üst
b36b0a37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
posixmodule.c
Modules/posixmodule.c
+22
-3
No files found.
Modules/posixmodule.c
Dosyayı görüntüle @
cb970730
...
@@ -5179,7 +5179,8 @@ enum posix_spawn_file_actions_identifier {
...
@@ -5179,7 +5179,8 @@ enum posix_spawn_file_actions_identifier {
static
int
static
int
parse_file_actions
(
PyObject
*
file_actions
,
parse_file_actions
(
PyObject
*
file_actions
,
posix_spawn_file_actions_t *file_actionsp)
posix_spawn_file_actions_t
*
file_actionsp
,
PyObject
*
temp_buffer
)
{
{
PyObject
*
seq
;
PyObject
*
seq
;
PyObject
*
file_action
=
NULL
;
PyObject
*
file_action
=
NULL
;
...
@@ -5224,9 +5225,13 @@ parse_file_actions(PyObject *file_actions,
...
@@ -5224,9 +5225,13 @@ parse_file_actions(PyObject *file_actions,
{
{
goto
fail
;
goto
fail
;
}
}
if
(
PyList_Append
(
temp_buffer
,
path
))
{
Py_DECREF
(
path
);
goto
fail
;
}
errno
=
posix_spawn_file_actions_addopen
(
file_actionsp
,
errno
=
posix_spawn_file_actions_addopen
(
file_actionsp
,
fd
,
PyBytes_AS_STRING
(
path
),
oflag
,
(
mode_t
)
mode
);
fd
,
PyBytes_AS_STRING
(
path
),
oflag
,
(
mode_t
)
mode
);
Py_DECREF(path);
/* addopen copied it. */
Py_DECREF
(
path
);
if
(
errno
)
{
if
(
errno
)
{
posix_error
();
posix_error
();
goto
fail
;
goto
fail
;
...
@@ -5309,6 +5314,7 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
...
@@ -5309,6 +5314,7 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
posix_spawn_file_actions_t
*
file_actionsp
=
NULL
;
posix_spawn_file_actions_t
*
file_actionsp
=
NULL
;
Py_ssize_t
argc
,
envc
;
Py_ssize_t
argc
,
envc
;
PyObject
*
result
=
NULL
;
PyObject
*
result
=
NULL
;
PyObject
*
temp_buffer
=
NULL
;
pid_t
pid
;
pid_t
pid
;
int
err_code
;
int
err_code
;
...
@@ -5349,7 +5355,19 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
...
@@ -5349,7 +5355,19 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
}
}
if
(
file_actions
!=
Py_None
)
{
if
(
file_actions
!=
Py_None
)
{
if (parse_file_actions(file_actions, &file_actions_buf)) {
/* There is a bug in old versions of glibc that makes some of the
* helper functions for manipulating file actions not copy the provided
* buffers. The problem is that posix_spawn_file_actions_addopen does not
* copy the value of path for some old versions of glibc (<2.20).
* The use of temp_buffer here is a workaround that keeps the
* python objects that own the buffers alive until posix_spawn gets called.
* Check https://bugs.python.org/issue33630 and
* https://sourceware.org/bugzilla/show_bug.cgi?id=17048 for more info.*/
temp_buffer
=
PyList_New
(
0
);
if
(
!
temp_buffer
)
{
goto
exit
;
}
if
(
parse_file_actions
(
file_actions
,
&
file_actions_buf
,
temp_buffer
))
{
goto
exit
;
goto
exit
;
}
}
file_actionsp
=
&
file_actions_buf
;
file_actionsp
=
&
file_actions_buf
;
...
@@ -5376,6 +5394,7 @@ exit:
...
@@ -5376,6 +5394,7 @@ exit:
if
(
argvlist
)
{
if
(
argvlist
)
{
free_string_array
(
argvlist
,
argc
);
free_string_array
(
argvlist
,
argc
);
}
}
Py_XDECREF
(
temp_buffer
);
return
result
;
return
result
;
}
}
#endif
/* HAVE_POSIX_SPAWN */
#endif
/* HAVE_POSIX_SPAWN */
...
...
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