diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-04-30 20:08:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-01 09:17:27 +0200 |
commit | fdbc8d1374e2a9fde6c99acbe6923a277695a0a3 (patch) | |
tree | 945aa7aa4638c47e76b5524e4c8f8d1e3e32b212 | |
parent | fe72e20f865baca9387e5d14327c56b2773d760f (diff) |
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: Ie1aff54bbc2d9dad0298636bf680ac7790f70a72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166941
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | sot/source/sdstor/stg.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/stgavl.cxx | 5 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 2 | ||||
-rw-r--r-- | svl/source/misc/strmadpt.cxx | 1 | ||||
-rw-r--r-- | svl/source/misc/urihelper.cxx | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 2b3e9a146908..86658536cb07 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -440,7 +440,7 @@ void Storage::Init( bool bCreate ) bool bHdrLoaded = false; bIsRoot = true; - OSL_ENSURE( pIo, "The pointer may not be empty at this point!" ); + assert(pIo && "The pointer may not be empty at this point!"); if( pIo->Good() && pIo->GetStrm() ) { sal_uInt64 nSize = pIo->GetStrm()->TellEnd(); diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index 98a86f3edb96..ac0c5f468024 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -59,7 +59,7 @@ sal_Int32 StgAvlNode::Locate sal_Int32 nRes = 0; StgAvlNode* pCur = this; - OSL_ENSURE( pPivot && pParent && pPrev, "The pointers may not be NULL!" ); + assert(pPivot && pParent && pPrev && "The pointers may not be NULL!"); *pParent = *pPrev = nullptr; *pPivot = this; @@ -94,10 +94,11 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode const * pNew ) StgAvlNode* pCur = this; short nDelta; // no traversing - OSL_ENSURE( pHeavy && pNew, "The pointers is not allowed to be NULL!" ); if( pCur == pNew || !pNew ) return m_nBalance; + assert(pHeavy && pNew && "The pointers is not allowed to be NULL!"); + sal_Int32 nRes = Compare( pNew ); if( nRes > 0 ) { diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 8a2da70793e6..a43e326ad877 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -724,7 +724,7 @@ void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p ) void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p ) { #if OSL_DEBUG_LEVEL > 0 - OSL_ENSURE( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" ); + assert(p && "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?"); SfxStyleSheetIterator aIter(this, p->GetFamily(), p->GetMask()); SfxStyleSheetBase* pOld = aIter.Find( p->GetName() ); diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 7a755d924986..919cb4ab3a45 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -591,6 +591,7 @@ void SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) = static_cast< Page * >(std::malloc( sizeof (Page) + m_nPageSize - 1)); + assert(pNew && "Don't handle OOM conditions"); pNew->m_pPrev = m_pWritePage; pNew->m_pNext = m_pWritePage->m_pNext; diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 71ab02491f55..d31a9e8cbe0c 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -136,7 +136,7 @@ enum Result { Success, GeneralFailure, SpecificFailure }; Result normalizePrefix( css::uno::Reference< css::ucb::XUniversalContentBroker > const & broker, OUString const & uri, OUString * normalized) { - OSL_ASSERT(broker.is() && normalized != nullptr); + assert(broker.is() && normalized != nullptr); css::uno::Reference< css::ucb::XContent > content; try { content = broker->queryContent(broker->createContentIdentifier(uri)); |