bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx |    1 +
 canvas/source/directx/dx_canvasbitmap.cxx           |    1 +
 extensions/source/scanner/twain32shim.cxx           |    1 +
 include/basegfx/raster/rasterconvert3d.hxx          |    3 ++-
 registry/source/regkey.cxx                          |    2 +-
 stoc/source/corereflection/criface.cxx              |    1 +
 stoc/source/proxy_factory/proxyfac.cxx              |    8 ++++----
 7 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit a2623abe07c5fe369c6b7315ae53de3884750839
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Apr 30 19:39:52 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Apr 30 22:04:11 2024 +0200

    WaE: C6011 Dereferencing NULL pointer warnings
    
    Change-Id: I498c10e8bc134b41e3606d8a05cf3103a9274735
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166937
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index e5836dd11d98..7dd6df9cb6ce 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -410,6 +410,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription* pTD) noexcept
     // 32 bit offsets
     const int totalSize = codeSize + typeInfoArraySize + excTypeAddLen;
     unsigned char* pCode = _code = static_cast<unsigned 
char*>(std::malloc(totalSize));
+    assert(pCode && "Don't handle OOM conditions");
     int pCodeOffset = 0;
 
     // New base of types array, starts after Trampoline D-Tor / C-Tors
diff --git a/canvas/source/directx/dx_canvasbitmap.cxx 
b/canvas/source/directx/dx_canvasbitmap.cxx
index fb06288ada86..cfef86a536ec 100644
--- a/canvas/source/directx/dx_canvasbitmap.cxx
+++ b/canvas/source/directx/dx_canvasbitmap.cxx
@@ -208,6 +208,7 @@ namespace dxcanvas
                     const sal_Int32 nScanWidth((aSize.getWidth() + 3) & ~3);
                     std::unique_ptr<sal_uInt8[]> pAlphaBits( new 
sal_uInt8[nScanWidth*aSize.getHeight()] );
                     const sal_uInt8* 
pInBits=static_cast<sal_uInt8*>(aBmpData.Scan0);
+                    assert(pInBits);
                     pInBits+=3;
                     for( sal_Int32 y=0; y<aSize.getHeight(); ++y )
                     {
diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 6e0be8149471..5827a946fedb 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -287,6 +287,7 @@ void ImpTwain::ImplOpenSource()
             TW_CAPABILITY aCap
                 = { CAP_XFERCOUNT, TWON_ONEVALUE, GlobalAlloc(GHND, 
sizeof(TW_ONEVALUE)) };
             TW_ONEVALUE* pVal = 
static_cast<TW_ONEVALUE*>(GlobalLock(aCap.hContainer));
+            assert(pVal);
 
             pVal->ItemType = TWTY_INT16;
             pVal->Item = 1;
diff --git a/include/basegfx/raster/rasterconvert3d.hxx 
b/include/basegfx/raster/rasterconvert3d.hxx
index 83f753e3184b..25cf2a333f06 100644
--- a/include/basegfx/raster/rasterconvert3d.hxx
+++ b/include/basegfx/raster/rasterconvert3d.hxx
@@ -21,6 +21,7 @@
 
 #include <config_options.h>
 #include <sal/types.h>
+#include <cassert>
 #include <vector>
 
 #include <osl/diagnose.h>
@@ -395,7 +396,7 @@ namespace basegfx
         {
             bool operator()(const RasterConversionLineEntry3D* pA, const 
RasterConversionLineEntry3D* pB)
             {
-                OSL_ENSURE(pA && pB, "lineComparator: empty pointer (!)");
+                assert(pA && pB && "lineComparator: empty pointer (!)");
                 return pA->getX().getVal() < pB->getX().getVal();
             }
         };
diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx
index b2eeb63e67a6..c9fc096eaf48 100644
--- a/registry/source/regkey.cxx
+++ b/registry/source/regkey.cxx
@@ -439,7 +439,7 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle 
hKey,
                                               char*** pValueList,
                                               sal_uInt32* pLen)
 {
-    OSL_PRECOND((pValueList != nullptr) && (pLen != nullptr), 
"registry::getStringListValue(): invalid parameter");
+    assert(pValueList != nullptr && pLen != nullptr && 
"registry::getStringListValue(): invalid parameter");
     *pValueList = nullptr;
     *pLen = 0;
 
diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 23d3d9bae278..130ff546e278 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -508,6 +508,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
             ppParamTypes[nPos] = nullptr;
             TYPELIB_DANGER_GET( ppParamTypes + nPos, pParams[nPos].pTypeRef );
             typelib_TypeDescription * pTD = ppParamTypes[nPos];
+            assert(pTD);
 
             ppUnoArgs[nPos] = alloca( pTD->nSize );
             if (pParams[nPos].bIn)
diff --git a/stoc/source/proxy_factory/proxyfac.cxx 
b/stoc/source/proxy_factory/proxyfac.cxx
index 6745d0163c70..a22bcc3fcafe 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -181,7 +181,7 @@ static void binuno_proxy_acquire( uno_Interface * pUnoI )
     // rebirth of zombie
     uno_ExtEnvironment * uno_env =
         that->m_root->m_factory->m_uno_env.get()->pExtEnv;
-    OSL_ASSERT( uno_env != nullptr );
+    assert(uno_env != nullptr);
     (*uno_env->registerProxyInterface)(
         uno_env, reinterpret_cast< void ** >( &pUnoI ), binuno_proxy_free,
         that->m_oid.pData,
@@ -198,7 +198,7 @@ static void binuno_proxy_release( uno_Interface * pUnoI )
     {
         uno_ExtEnvironment * uno_env =
             that->m_root->m_factory->m_uno_env.get()->pExtEnv;
-        OSL_ASSERT( uno_env != nullptr );
+        assert(uno_env != nullptr);
         (*uno_env->revokeInterface)( uno_env, pUnoI );
     }
 }
@@ -289,7 +289,7 @@ Any ProxyRoot::queryAggregation( Type const & rType )
         {
             Reference< XInterface > xProxy;
             uno_ExtEnvironment * cpp_env = m_factory->m_cpp_env.get()->pExtEnv;
-            OSL_ASSERT( cpp_env != nullptr );
+            assert(cpp_env != nullptr);
 
             // mind a new delegator, calculate current root:
             Reference< XInterface > xRoot(
@@ -323,7 +323,7 @@ Any ProxyRoot::queryAggregation( Type const & rType )
                         SAL_NO_ACQUIRE );
                     uno_ExtEnvironment * uno_env =
                         m_factory->m_uno_env.get()->pExtEnv;
-                    OSL_ASSERT( uno_env != nullptr );
+                    assert(uno_env != nullptr);
                     (*uno_env->registerProxyInterface)(
                         uno_env, reinterpret_cast< void ** >( &proxy.m_pUnoI ),
                         binuno_proxy_free, oid.pData,

Reply via email to