summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-01 00:25:16 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-01 00:49:12 +0200
commit85456fae54029edd26df2277a9eec5e2fe3d9739 (patch)
treefd55ad48b34c66f0b839edcbc952a8a5a0752c72 /cppu
parent1d35b89e7581e12024769d19bfb6d6eb2c3274b8 (diff)
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/uno/copy.hxx7
1 files changed, 7 insertions, 0 deletions
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 <cassert>
#include <cstdlib>
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<sal_Int64 *>(pDestAny->pData) = *static_cast<sal_Int64 *>(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<float *>(pDestAny->pData) = *static_cast<float *>(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<double *>(pDestAny->pData) = *static_cast<double *>(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<sal_Int64 *>(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<float *>(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<double *>(pDestAny->pData) = 0.0;
break;
case typelib_TypeClass_STRING: