diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-10-04 17:06:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 17:06:17 (GMT) |
commit | 938223e8d1eabdd6a73531a8dd52407ef23f6375 (patch) | |
tree | bd405cf9aa3cc219b3933c17aa8484905fbfd298 /PC/_msi.c | |
parent | 41188134bd2120f0cedd681ed88743c11c7f3742 (diff) | |
download | cpython-938223e8d1eabdd6a73531a8dd52407ef23f6375.zip cpython-938223e8d1eabdd6a73531a8dd52407ef23f6375.tar.gz cpython-938223e8d1eabdd6a73531a8dd52407ef23f6375.tar.bz2 |
[3.9] gh-96577: Fixes buffer overrun in _msi module (GH-96633) (GH-96657)
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
(cherry picked from commit 4114bcc9ef7595a07196bcecf9c7d6d39f57f64d)
Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'PC/_msi.c')
-rw-r--r-- | PC/_msi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -292,7 +292,7 @@ msierror(int status) int code; char buf[2000]; char *res = buf; - DWORD size = sizeof(buf); + DWORD size = Py_ARRAY_LENGTH(buf); MSIHANDLE err = MsiGetLastErrorRecord(); if (err == 0) { @@ -386,7 +386,7 @@ record_getstring(msiobj* record, PyObject* args) unsigned int status; WCHAR buf[2000]; WCHAR *res = buf; - DWORD size = sizeof(buf); + DWORD size = Py_ARRAY_LENGTH(buf); PyObject* string; if (!PyArg_ParseTuple(args, "I:GetString", &field)) |