diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-27 19:43:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-27 21:55:55 +0100 |
commit | 780e1ffb991f3bfc4e8a73714b0e2a464feb3a86 (patch) | |
tree | 70cbac9e7b04be6d80aa0f062623d4237b3c6b27 /include/o3tl | |
parent | 618cb39b558b7e3f9a6f2aa8cf0a935602118388 (diff) |
cid#1473755 Untrusted loop bound
deem_sanizize isn't sufficiently complex to sanize its input apparently
Change-Id: Id1d73feefce9b587a8024021d8766267b105b4f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113234
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/safeint.hxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx index ef0b6593ad76..801b3dc6fdd5 100644 --- a/include/o3tl/safeint.hxx +++ b/include/o3tl/safeint.hxx @@ -239,17 +239,11 @@ make_unsigned(T value) // tools like -fsanitize=implicit-conversion should still be able to detect truncation: template<typename T1, typename T2> constexpr T1 narrowing(T2 value) { return value; } -// inform coverity that the returned value is now deemed sanitized -// coverity[ -taint_source ] -template<typename T> [[nodiscard]] constexpr T deem_sanitized(T a) -{ - return a; -} - // std::min wrapped to inform coverity that the result is now deemed sanitized +// coverity[ -taint_source ] template<typename T> [[nodiscard]] inline T sanitizing_min(T a, T b) { - return o3tl::deem_sanitized(std::min(a, b)); + return std::min(a, b); } } |