Skip to content
Snippets Groups Projects
Unverified Commit 12c72d68 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub
Browse files

[3.8] gh-96577: Fixes buffer overrun in _msi module (GH-96633) (GH-96658)


gh-96577: Fixes buffer overrun in _msi module (GH-96633)
(cherry picked from commit 4114bcc9)

Co-authored-by: default avatarSteve Dower <steve.dower@python.org>
parent 069b7186
No related branches found
No related tags found
No related merge requests found
Fixes a potential buffer overrun in :mod:`msilib`.
...@@ -292,7 +292,7 @@ msierror(int status) ...@@ -292,7 +292,7 @@ msierror(int status)
int code; int code;
char buf[2000]; char buf[2000];
char *res = buf; char *res = buf;
DWORD size = sizeof(buf); DWORD size = Py_ARRAY_LENGTH(buf);
MSIHANDLE err = MsiGetLastErrorRecord(); MSIHANDLE err = MsiGetLastErrorRecord();
if (err == 0) { if (err == 0) {
...@@ -386,7 +386,7 @@ record_getstring(msiobj* record, PyObject* args) ...@@ -386,7 +386,7 @@ record_getstring(msiobj* record, PyObject* args)
unsigned int status; unsigned int status;
WCHAR buf[2000]; WCHAR buf[2000];
WCHAR *res = buf; WCHAR *res = buf;
DWORD size = sizeof(buf); DWORD size = Py_ARRAY_LENGTH(buf);
PyObject* string; PyObject* string;
if (!PyArg_ParseTuple(args, "I:GetString", &field)) if (!PyArg_ParseTuple(args, "I:GetString", &field))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment