From c79a48a75f7f44b5a042109251e185fc4695cde6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 12 May 2024 18:41:16 +0100 Subject: [PATCH] WaE: C6011 Dereferencing NULL pointer warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ica8b3c8c5476f2f0f3bebf0cfcd80b08090c6119 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167556 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 1 + jvmfwk/source/elements.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 1610188f55ac..21258af12944 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -539,6 +539,7 @@ static bool getJavaInfoFromRegistry(const wchar_t* szRegKey, if( RegQueryValueExW(hKey, L"JavaHome", nullptr, &dwType, nullptr, &dwTmpPathLen)== ERROR_SUCCESS) { unsigned char* szTmpPath= static_cast(malloc(dwTmpPathLen+sizeof(sal_Unicode))); + assert(szTmpPath && "Don't handle OOM conditions"); // According to https://msdn.microsoft.com/en-us/ms724911, the application should ensure // that the string is properly terminated before using it for (DWORD i = 0; i < sizeof(sal_Unicode); ++i) diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index d47af20f2e4b..00ad1d741667 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -683,7 +683,7 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo) OString sExcMsg("[Java framework] Error in function NodeJavaInfo::loadFromNode " "(elements.cxx)."_ostr); - OSL_ASSERT(pJavaInfo && pDoc); + assert(pJavaInfo && pDoc); if (pJavaInfo->children == nullptr) return; //Get the xsi:nil attribute; -- 2.11.4.GIT