Kaydet (Commit) be4ac035 authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

INTEGRATION: CWS ab17fixes (1.13.8); FILE MERGED

2005/09/29 18:31:11 hr 1.13.8.3: #i10000: manual resync; repair broken CWS
2005/06/20 11:17:24 ab 1.13.8.2: RESYNC: (1.13-1.14); FILE MERGED
2005/05/04 14:12:40 ab 1.13.8.1: #i45570# SbiImage::AddString(): Fixed overflow problem
üst cef8ad25
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: image.cxx,v $ * $RCSfile: image.cxx,v $
* *
* $Revision: 1.17 $ * $Revision: 1.18 $
* *
* last change: $Author: hr $ $Date: 2005-09-29 16:33:14 $ * last change: $Author: hr $ $Date: 2005-09-29 18:38:33 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -383,10 +383,12 @@ void SbiImage::AddString( const String& r ) ...@@ -383,10 +383,12 @@ void SbiImage::AddString( const String& r )
bError = TRUE; // out of mem! bError = TRUE; // out of mem!
else if( (USHORT) needed > nStringSize ) else if( (USHORT) needed > nStringSize )
{ {
UINT16 nNewLen = needed + 1024; UINT32 nNewLen = needed + 1024;
nNewLen &= 0xFC00; // trim to 1K border nNewLen &= 0xFFFFFC00; // trim to 1K border
sal_Unicode* p = new sal_Unicode[ nNewLen ]; if( nNewLen > 0xFF00L )
if( p ) nNewLen = 0xFF00L;
sal_Unicode* p = NULL;
if( (p = new sal_Unicode[ nNewLen ]) != NULL )
{ {
memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) ); memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) );
delete[] pStrings; delete[] pStrings;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment