From 85456fae54029edd26df2277a9eec5e2fe3d9739 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 1 Apr 2019 00:25:16 +0300 Subject: tdf#120703 PVS: Silence V522 warnings V522 There might be dereferencing of a potential null pointer. Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48 Reviewed-on: https://gerrit.libreoffice.org/70017 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- cppu/source/uno/copy.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cppu') diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx index 79c738f7f37b..b0811b5fab10 100644 --- a/cppu/source/uno/copy.hxx +++ b/cppu/source/uno/copy.hxx @@ -21,6 +21,7 @@ #include "prim.hxx" #include "constr.hxx" +#include #include namespace cppu @@ -138,6 +139,7 @@ inline void _copyConstructAnyFromData( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(sal_Int64) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = *static_cast(pSource); break; case typelib_TypeClass_FLOAT: @@ -145,6 +147,7 @@ inline void _copyConstructAnyFromData( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(float) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = *static_cast(pSource); break; case typelib_TypeClass_DOUBLE: @@ -152,6 +155,7 @@ inline void _copyConstructAnyFromData( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(double) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = *static_cast(pSource); break; case typelib_TypeClass_STRING: @@ -297,6 +301,7 @@ inline void _copyConstructAny( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(sal_Int64) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = 0; break; case typelib_TypeClass_FLOAT: @@ -304,6 +309,7 @@ inline void _copyConstructAny( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(float) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = 0.0; break; case typelib_TypeClass_DOUBLE: @@ -311,6 +317,7 @@ inline void _copyConstructAny( pDestAny->pData = &pDestAny->pReserved; else pDestAny->pData = std::malloc( sizeof(double) ); + assert(pDestAny->pData); *static_cast(pDestAny->pData) = 0.0; break; case typelib_TypeClass_STRING: -- cgit