include/sal/types.h | 2 +- sw/source/uibase/dochdl/swdtflvr.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
New commits: commit 2cbbda18478506c56bedccf0da31602085f9a23c Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 12 08:46:01 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 12 12:06:46 2025 +0200 cid#1662533 Dereference null return value Change-Id: I501c750f65c86424e4b99ca0bd7a6932f93e8635 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189399 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index f328848c2523..de36a47e7d02 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2231,7 +2231,8 @@ bool SwTransferable::PasteFileContent( const TransferableDataHelper& rData, if(aFormats.size() > 1) { - GenericDropDownFieldDialog aDialog(GetActiveView()->GetFrameWeld(), + const SwView* pView = GetActiveView(); + GenericDropDownFieldDialog aDialog(pView ? pView->GetFrameWeld() : nullptr, SvxResId(RID_SVXSTR_PASTE_AS_DIALOG_TITLE), aFormats); short nRet = aDialog.run(); commit b15bbced0c47cd6b1a6b50af5480b392ccf4b6b1 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Aug 10 19:25:55 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 12 12:06:40 2025 +0200 use /*coverity[+returnsnull]*/ as fallback for SAL_RET_MAYBENULL +returnsnull / -returnsnull Specifies that a function might / might not return NULL. In the positive case, the return value must be verified to be non-NULL before it is dereferenced. For example, the +returnsnull annotation in the following code specifies that the value of fetch_ptr should always be verified. Unverified values will be reported by the NULL_RETURNS checker (and do not depend on statistical analysis). //coverity[+returnsnull] int* fetch_ptr(int idx) { ... } Change-Id: I827b665d3bc01546c8596457c50ebd860894f677 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189397 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/include/sal/types.h b/include/sal/types.h index 8d220652ea68..8e6acb634c4b 100644 --- a/include/sal/types.h +++ b/include/sal/types.h @@ -298,7 +298,7 @@ typedef void * sal_Handle; #ifdef _MSC_VER # define SAL_RET_MAYBENULL _Ret_maybenull_ #else -# define SAL_RET_MAYBENULL +# define SAL_RET_MAYBENULL /*coverity[+returnsnull]*/ #endif #endif