summaryrefslogtreecommitdiffstats
path: root/cppu/source/uno/sequence.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/uno/sequence.cxx')
-rw-r--r--cppu/source/uno/sequence.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index c467f2c38704..1a8da6d53c96 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <cassert>
+#include <cstdlib>
#include <string.h>
#include <osl/diagnose.h>
@@ -227,6 +228,9 @@ static bool idefaultConstructElements(
{
typelib_TypeDescription * pElementTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElementTypeDescr, pElementType );
+ if (pElementTypeDescr == nullptr) {
+ std::abort();
+ }
sal_Int32 eEnum =
reinterpret_cast<typelib_EnumTypeDescription *>(
pElementTypeDescr)->nDefaultEnumValue;
@@ -245,6 +249,9 @@ static bool idefaultConstructElements(
{
typelib_TypeDescription * pElementTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElementTypeDescr, pElementType );
+ if (pElementTypeDescr == nullptr) {
+ std::abort();
+ }
sal_Int32 nElementSize = pElementTypeDescr->nSize;
if (nAlloc >= 0)
@@ -471,6 +478,9 @@ static bool icopyConstructFromElements(
{
typelib_TypeDescription * pElementTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElementTypeDescr, pElementType );
+ if (pElementTypeDescr == nullptr) {
+ std::abort();
+ }
sal_Int32 nElementSize = pElementTypeDescr->nSize;
pSeq = reallocSeq( pSeq, nElementSize, nAlloc );
@@ -522,6 +532,9 @@ static bool icopyConstructFromElements(
{
typelib_TypeDescription * pElementTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElementTypeDescr, pElementType );
+ if (pElementTypeDescr == nullptr) {
+ std::abort();
+ }
typelib_TypeDescriptionReference * pSeqElementType =
reinterpret_cast<typelib_IndirectTypeDescription *>(pElementTypeDescr)->pType;
uno_Sequence ** pDestElements = reinterpret_cast<uno_Sequence **>(pSeq->elements);
@@ -664,6 +677,9 @@ sal_Bool SAL_CALL uno_type_sequence_construct(
{
typelib_TypeDescription * pTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pTypeDescr, pType );
+ if (pTypeDescr == nullptr) {
+ std::abort();
+ }
typelib_TypeDescriptionReference * pElementType =
reinterpret_cast<typelib_IndirectTypeDescription *>(pTypeDescr)->pType;
@@ -763,7 +779,7 @@ sal_Bool SAL_CALL uno_sequence_realloc(
sal_Int32 nSize, uno_AcquireFunc acquire, uno_ReleaseFunc release )
SAL_THROW_EXTERN_C()
{
- OSL_ENSURE( ppSequence, "### null ptr!" );
+ assert(ppSequence && "### null ptr!");
OSL_ENSURE( nSize >= 0, "### new size must be at least 0!" );
bool ret = true;
@@ -783,7 +799,7 @@ sal_Bool SAL_CALL uno_type_sequence_reference2One(
uno_AcquireFunc acquire, uno_ReleaseFunc release )
SAL_THROW_EXTERN_C()
{
- OSL_ENSURE( ppSequence, "### null ptr!" );
+ assert(ppSequence && "### null ptr!");
bool ret = true;
uno_Sequence * pSequence = *ppSequence;
if (pSequence->nRefCount > 1)
@@ -830,7 +846,7 @@ sal_Bool SAL_CALL uno_sequence_reference2One(
uno_AcquireFunc acquire, uno_ReleaseFunc release )
SAL_THROW_EXTERN_C()
{
- OSL_ENSURE( ppSequence, "### null ptr!" );
+ assert(ppSequence && "### null ptr!");
bool ret = true;
uno_Sequence * pSequence = *ppSequence;
if (pSequence->nRefCount > 1)