Kaydet (Commit) 3bd5680f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Fix off-by-one error: The XCollection loop index is one-based

We must compare the index against the number of entries with '>' and
not '>='.

Change-Id: I2de9e53b2a0d923d4136ee5e093baa955c8301da
Reviewed-on: https://gerrit.libreoffice.org/55405Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 6b891581
......@@ -2069,7 +2069,7 @@ public:
ULONG nReturned = 0;
while (nLeft > 0)
{
if (mnIndex >= mxCollection->getCount())
if (mnIndex > mxCollection->getCount())
{
SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Next(" << celt << "): got " << nReturned << ": S_FALSE");
return S_FALSE;
......@@ -2104,7 +2104,7 @@ public:
ULONG nSkipped = 0;
while (celt > 0)
{
if (mnIndex >= mxCollection->getCount())
if (mnIndex > mxCollection->getCount())
{
SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Skip(" << celt << "): skipped " << nSkipped << ": S_FALSE");
return S_FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment