summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-03-30 15:31:24 +0000
committerRüdiger Timm <rt@openoffice.org>2004-03-30 15:31:24 +0000
commit8805b0de5383c81ee832073b37e8ae1166bd23c0 (patch)
tree782b68d920bbbe4abd70cdfacbb1b9463c4e36af /sal/rtl
parent19da84593fe4b88bde9f9b20ed0a5bcbaa578d56 (diff)
INTEGRATION: CWS sb14 (1.11.166); FILE MERGED
2004/03/11 14:41:35 sb 1.11.166.1: #i21150# rtl_string2UString and OUString::OUString(sal_Char const *, sal_Int32, rtl_TextEncoding, sal_uInt32) handle out-of-memory conditions.
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/source/string.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sal/rtl/source/string.c b/sal/rtl/source/string.c
index e20c6ba9ec6f..31baa7a594de 100644
--- a/sal/rtl/source/string.c
+++ b/sal/rtl/source/string.c
@@ -2,9 +2,9 @@
*
* $RCSfile: string.c,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: hr $ $Date: 2003-03-26 16:46:40 $
+ * last change: $Author: rt $ $Date: 2004-03-30 16:31:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -265,6 +265,7 @@ sal_Bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
if ( *pTarget )
IMPL_RTL_STRINGNAME( release )( *pTarget );
*pTarget = IMPL_RTL_STRINGNAME( ImplAlloc )( nLength );
+ OSL_ASSERT(*pTarget != NULL);
pBuffer = (*pTarget)->buffer;
do
{
@@ -303,6 +304,7 @@ sal_Bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
for (;;)
{
pTemp = IMPL_RTL_STRINGNAME( ImplAlloc )( nNewLen );
+ OSL_ASSERT(pTemp != NULL);
nDestBytes = rtl_convertUnicodeToText( hConverter, 0,
pSource, nLength,
pTemp->buffer, nNewLen,
@@ -332,6 +334,7 @@ sal_Bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
if ( nNewLen > nDestBytes+8 )
{
rtl_String* pTemp2 = IMPL_RTL_STRINGNAME( ImplAlloc )( nDestBytes );
+ OSL_ASSERT(pTemp2 != NULL);
rtl_str_ImplCopy( pTemp2->buffer, pTemp->buffer, nDestBytes );
rtl_freeMemory( pTemp );
pTemp = pTemp2;