summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-12-19 18:47:09 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-19 18:50:45 +0100
commit371ed6894aa1ea7dd5bff75131fc43b208fbb031 (patch)
treef954ce12353e78956ddd36fa6a5c287a254e09a9 /sal
parentd1f56fe90c99bdff83990035f5518266916b980b (diff)
don't use shared empty string if extra space is to be allocated
fix crash for fdo#58306 when appending to OUStringBuffer initialised with ""
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/source/strtmpl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index 8001e0a250a7..f9d7a5ef59a7 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -1215,7 +1215,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromLiteral )( IMPL_RTL_STRINGDATA** ppThi
sal_Int32 allocExtra )
SAL_THROW_EXTERN_C()
{
- if ( !nLen )
+ if ( nLen + allocExtra == 0 )
{
IMPL_RTL_STRINGNAME( new )( ppThis );
return;