diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-24 10:15:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-24 21:32:10 +0100 |
commit | 69a32bec9b7121bd56560896828e76059bb49012 (patch) | |
tree | b1749d62dd3f97d45c6929eb0b91dd841bf8dc20 /tools | |
parent | 0f02651d693b131060595313db31c7b4b8dad528 (diff) |
cid#1474353 experiment to silence Untrusted loop bound
the value *is* surely sanity checked here despite coverity's
bleating that it has passed through std::min unchanged when
it is the min value
Change-Id: Ic4f2b718832f88528f842280b4c0e04c4b3a9444
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113031
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/stream/stream.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index f807a56cf52f..2b7f8b08b1a3 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1962,7 +1962,7 @@ OUString read_uInt16s_ToOUString(SvStream& rStrm, std::size_t nLen) { nLen = std::min<std::size_t>(nLen, SAL_MAX_INT32); //limit allocation to size of file, but + 1 to set eof state - nLen = std::min<sal_uInt64>(nLen, (rStrm.remainingSize() + 2) / 2); + nLen = o3tl::sanitizing_min<sal_uInt64>(nLen, (rStrm.remainingSize() + 2) / 2); //alloc a (ref-count 1) rtl_uString of the desired length. //rtl_String's buffer is uninitialized, except for null termination pStr = rtl_uString_alloc(sal::static_int_cast<sal_Int32>(nLen)); |