The return value of XConnection::read 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: Id2bea3010bf67bdaeb0766b20baecba195bf0181
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135227
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2022-06-01 10:34:07 +02:00
parent 9b453e699f
commit 7d8d65d850

View file

@ -71,7 +71,7 @@ css::uno::Sequence< sal_Int8 > read(
if (n == 0 && eofOk) {
return css::uno::Sequence< sal_Int8 >();
}
if (n != static_cast< sal_Int32 >(size)) {
if (o3tl::make_unsigned(n) != size) {
throw css::io::IOException(
"binaryurp::Reader: premature end of input");
}