diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-10-27 14:54:45 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-10-27 14:54:45 +0000 |
commit | 449097ea475f8b4058eae9a321acd85e0cba9276 (patch) | |
tree | ac17e348d36733859200737302359813be4d0e83 /xmloff | |
parent | 483d3ea0e6bf59cf8f8423b4a0bb018dd53f262b (diff) |
INTEGRATION: CWS mib02 (1.16.32); FILE MERGED
2005/09/28 21:19:23 mib 1.16.32.2: RESYNC: (1.16-1.17); FILE MERGED
2005/08/23 06:13:38 mib 1.16.32.1: #i50288#: Limit encoded style name length and avoid memory overflow
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/transform/TransformerBase.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index c20fd4c2d7..54643ee8dc 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -4,9 +4,9 @@ * * $RCSfile: TransformerBase.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: rt $ $Date: 2005-09-09 15:57:58 $ + * last change: $Author: hr $ $Date: 2005-10-27 15:54:45 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1073,7 +1073,7 @@ sal_Bool XMLTransformerBase::EncodeStyleName( OUString& rName ) const sal_Int32 nLen = rName.getLength(); OUStringBuffer aBuffer( nLen ); - for( xub_StrLen i = 0; i < nLen; i++ ) + for( sal_Int32 i = 0; i < nLen; i++ ) { sal_Unicode c = rName[i]; sal_Bool bValidChar = sal_False; @@ -1177,6 +1177,9 @@ sal_Bool XMLTransformerBase::EncodeStyleName( OUString& rName ) const } } + if( aBuffer.getLength() > (1<<15)-1 ) + bEncoded = sal_False; + if( bEncoded ) rName = aBuffer.makeStringAndClear(); return bEncoded; @@ -1191,7 +1194,7 @@ sal_Bool XMLTransformerBase::DecodeStyleName( OUString& rName ) sal_Bool bWithinHex = sal_False; sal_Unicode cEnc = 0; - for( xub_StrLen i = 0; i < nLen; i++ ) + for( sal_Int32 i = 0; i < nLen; i++ ) { sal_Unicode c = rName[i]; if( '_' == c ) |