Skip to content

Commit

Permalink
SAFEARRAY(VT_RECORD) missing last element. (#2263)
Browse files Browse the repository at this point in the history
Fixes #2247.

Co-authored-by: Avasam <samuel.06@hotmail.com>
  • Loading branch information
mhammond and Avasam committed May 28, 2024
1 parent 11fda91 commit d7fc9a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Notable changes in recent builds.
Notable changes in recent builds.

Maintained by hand, so what's "notable" is subjective! Contributors are
encouraged to add entries for their work.
Expand All @@ -14,6 +14,7 @@ https://mhammond.github.io/pywin32_installers.html.
Coming in build 307, as yet unreleased
--------------------------------------
### pywin32
* Fixed VT_SAFEARRAY(VT_RECORD) which were missing the last element (#2247)
* Fixed `MFC redist DLLs not found` by preferring corresponding version but accepting different version (#2248, @andreabravetti)
* Fixed `pywintypes.error: (5, 'RegOpenKeyEx', 'Access is denied.')` when running service with debug parameter and no elevation (#2238, @jmartens)
* Fixed handling of `SyntaxError` exception from a Windows Scripting Host Python Script on Python 3.10+ (#2235, @nbbeatty)
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/src/PyRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PyObject *PyObject_FromSAFEARRAYRecordInfo(SAFEARRAY *psa)
hr = SafeArrayGetLBound(psa, 1, &lbound);
if (FAILED(hr))
goto exit;
nelems = ubound - lbound;
nelems = ubound - lbound + 1;
hr = info->GetSize(&cb_elem);
if (FAILED(hr))
goto exit;
Expand Down Expand Up @@ -522,7 +522,7 @@ PyObject *PyRecord::getattro(PyObject *self, PyObject *obname)
hr = sub->GetSize(&element_size);
if (FAILED(hr))
goto array_end;
nelems = ubound - lbound;
nelems = ubound - lbound + 1;
ret_tuple = PyTuple_New(nelems);
if (ret_tuple == NULL)
goto array_end;
Expand Down

0 comments on commit d7fc9a3

Please sign in to comment.