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
b420601f
Kaydet (Commit)
b420601f
authored
Eyl 09, 2016
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24594: Validates persist parameter when opening MSI database
üst
fc7e4300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
NEWS
Misc/NEWS
+2
-0
_msi.c
PC/_msi.c
+17
-3
No files found.
Misc/NEWS
Dosyayı görüntüle @
b420601f
...
...
@@ -42,6 +42,8 @@ Core and Builtins
Library
-------
- Issue #24594: Validates persist parameter when opening MSI database
- Issue #27570: Avoid zero-length memcpy() etc calls with null source
pointers in the "ctypes" and "array" modules.
...
...
PC/_msi.c
Dosyayı görüntüle @
b420601f
...
...
@@ -938,6 +938,17 @@ static PyTypeObject msidb_Type = {
0
,
/*tp_is_gc*/
};
#define Py_NOT_PERSIST(x, flag) \
(x != (int)(flag) && \
x != ((int)(flag) | MSIDBOPEN_PATCHFILE))
#define Py_INVALID_PERSIST(x) \
(Py_NOT_PERSIST(x, MSIDBOPEN_READONLY) && \
Py_NOT_PERSIST(x, MSIDBOPEN_TRANSACT) && \
Py_NOT_PERSIST(x, MSIDBOPEN_DIRECT) && \
Py_NOT_PERSIST(x, MSIDBOPEN_CREATE) && \
Py_NOT_PERSIST(x, MSIDBOPEN_CREATEDIRECT))
static
PyObject
*
msiopendb
(
PyObject
*
obj
,
PyObject
*
args
)
{
int
status
;
...
...
@@ -945,11 +956,14 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args)
int
persist
;
MSIHANDLE
h
;
msiobj
*
result
;
if
(
!
PyArg_ParseTuple
(
args
,
"si:MSIOpenDatabase"
,
&
path
,
&
persist
))
return
NULL
;
status
=
MsiOpenDatabase
(
path
,
(
LPCSTR
)
persist
,
&
h
);
/* We need to validate that persist is a valid MSIDBOPEN_* value. Otherwise,
MsiOpenDatabase may treat the value as a pointer, leading to unexpected
behavior. */
if
(
Py_INVALID_PERSIST
(
persist
))
return
msierror
(
ERROR_INVALID_PARAMETER
);
status
=
MsiOpenDatabase
(
path
,
(
LPCSTR
)
persist
,
&
h
);
if
(
status
!=
ERROR_SUCCESS
)
return
msierror
(
status
);
...
...
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