diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-06-07 10:31:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-06-07 11:53:25 +0200 |
commit | 3bd5680f7c71c5a6a8829f2b19d92744d7cbb56a (patch) | |
tree | 86368018b32f09e940853fbb0bac48a088e5d8f2 /extensions/source | |
parent | 6b8915816242215208e1bb18cfbf01ae85619c46 (diff) |
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/55405
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index aa160fa1141a..ca31169b1b6f 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -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; |