summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-05-13 13:24:59 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-05-13 13:24:59 +0200
commit375a6c7a909573cea64aacd64d2a14236a371ba2 (patch)
treefe15ae76f6539f2536005d0f67cc35eca9fc4d31 /basic
parent3beaccc09dfedc560d171dbbf26f2592e046d903 (diff)
i#64348 basic: fix CDec() crash if string is empty
This time without memory leak. Change-Id: If4474004124b7497b8451030a13db36887ead737
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxdec.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 59f5e015a737..ba2fc8a40a2e 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,9 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- pnDecRes->setString( p->pOUString ); break;
+ if ( p->pOUString )
+ pnDecRes->setString( p->pOUString );
+ break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);