sal/osl/unx/pipe.cxx | 4 +--- vcl/source/treelist/imap2.cxx | 13 +++++++++---- 2 files changed, 10 insertions(+), 7 deletions(-)
New commits: commit 7c49f6c89e7501f4b5ca28a45a91c6cdac5eb01b Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 30 09:45:36 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 31 22:08:20 2024 +0200 cid#1608005 Overflowed constant Change-Id: Iecc3ff0e7651ec52a2372d383f1d82c454d9dbd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172697 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx index 559658581ca5..f905ca52f533 100644 --- a/vcl/source/treelist/imap2.cxx +++ b/vcl/source/treelist/imap2.cxx @@ -282,11 +282,16 @@ void ImageMap::ImpReadCERNLine( std::string_view rLine ) } else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) ) { - const sal_uInt16 nCount = comphelper::string::getTokenCount(aStr, '(') - 1; - tools::Polygon aPoly( nCount ); + const sal_Int32 nTokenCount = comphelper::string::getTokenCount(aStr, '('); + tools::Polygon aPoly; + if (nTokenCount > 0) + { + const sal_uInt16 nCount = nTokenCount - 1; + aPoly.SetSize(nCount); - for ( sal_uInt16 i = 0; i < nCount; i++ ) - aPoly[ i ] = ImpReadCERNCoords( &pStr ); + for (sal_uInt16 i = 0; i < nCount; ++i) + aPoly[ i ] = ImpReadCERNCoords( &pStr ); + } const OUString aURL = ImpReadCERNURL( &pStr ); commit 68730a0e14d2ea37d5aa78bb19d16d5a5ee9d9ae Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 30 09:17:14 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 31 22:08:09 2024 +0200 assign immediately Change-Id: I2e92313a2428252422b68dd5fd353425add21025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172696 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index 618ca23ed108..a4778bde66f6 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -506,9 +506,7 @@ sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void *pBuffer , sal_Int32 n ) SAL_WARN_IF(!pPipe, "sal.osl.pipe", "osl_readPipe: invalid pipe"); // osl_receivePipe detects invalid pipe while (BytesToRead > 0) { - sal_Int32 RetVal; - RetVal= osl_receivePipe(pPipe, pBuffer, BytesToRead); - + sal_Int32 RetVal = osl_receivePipe(pPipe, pBuffer, BytesToRead); /* error occurred? */ if (RetVal <= 0) break;