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
6ceda631
Kaydet (Commit)
6ceda631
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
94a7927c
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 @
6ceda631
...
@@ -62,6 +62,8 @@ Core and Builtins
...
@@ -62,6 +62,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
24594
:
Validates
persist
parameter
when
opening
MSI
database
-
Issue
#
28047
:
Fixed
calculation
of
line
length
used
for
the
base64
CTE
-
Issue
#
28047
:
Fixed
calculation
of
line
length
used
for
the
base64
CTE
in
the
new
email
policies
.
in
the
new
email
policies
.
...
...
PC/_msi.c
Dosyayı görüntüle @
6ceda631
...
@@ -955,6 +955,17 @@ static PyTypeObject msidb_Type = {
...
@@ -955,6 +955,17 @@ static PyTypeObject msidb_Type = {
0
,
/*tp_is_gc*/
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
)
static
PyObject
*
msiopendb
(
PyObject
*
obj
,
PyObject
*
args
)
{
{
int
status
;
int
status
;
...
@@ -962,11 +973,14 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args)
...
@@ -962,11 +973,14 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args)
int
persist
;
int
persist
;
MSIHANDLE
h
;
MSIHANDLE
h
;
msiobj
*
result
;
msiobj
*
result
;
if
(
!
PyArg_ParseTuple
(
args
,
"si:MSIOpenDatabase"
,
&
path
,
&
persist
))
if
(
!
PyArg_ParseTuple
(
args
,
"si:MSIOpenDatabase"
,
&
path
,
&
persist
))
return
NULL
;
return
NULL
;
/* We need to validate that persist is a valid MSIDBOPEN_* value. Otherwise,
status
=
MsiOpenDatabase
(
path
,
(
LPCSTR
)
persist
,
&
h
);
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
)
if
(
status
!=
ERROR_SUCCESS
)
return
msierror
(
status
);
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