From e89e3a8b5a7639f14833d066e8a6c445dca97cc0 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 1 Jun 2022 09:09:46 +0200 Subject: The return value of those getLength functions is guaranteed to be non-negative ...so use o3tl::make_unsigned when comparing it against an expression of unsigned integer type, instead of casting that expression to a signed type Change-Id: Ic47c6d96919b2aba2d16ce6d1a2a8e4c5761a480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135219 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- binaryurp/source/reader.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'binaryurp') diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx index 91f2e51a0f25..7cabbd41c8a1 100644 --- a/binaryurp/source/reader.cxx +++ b/binaryurp/source/reader.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ css::uno::Sequence< sal_Int8 > read( throw css::io::IOException( "binaryurp::Reader: premature end of input"); } - assert(buf.getLength() == static_cast< sal_Int32 >(size)); + assert(o3tl::make_unsigned(buf.getLength()) == size); return buf; } -- cgit