summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-05-13 05:22:47 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-05-13 05:26:06 +0200
commit375b01bf747bb206c3fd6bad0acbd38271a8fb86 (patch)
tree029a4669e90a64899da937efd065d959eb5b880f
parent52136cd3a2737aa913bd59d1d5d88c841a984846 (diff)
i#64348 basic: fix CDec() crash if string is empty
Change-Id: I92e9472e14c00a6550081f0d58a352faa5b78b98
-rw-r--r--basic/source/sbx/sbxdec.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 59f5e015a737..f0cab347e512 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -194,6 +194,8 @@ void SbxDecimal::setUInt( unsigned int val )
bool SbxDecimal::setString( OUString* pOUString )
{
+ assert(pOUString);
+
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
// Convert delimiter
@@ -471,7 +473,11 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- pnDecRes->setString( p->pOUString ); break;
+ if( !p->pOUString )
+ pnDecRes->setString( new OUString );
+ else
+ pnDecRes->setString( p->pOUString );
+ break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);