summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2002-11-07 13:54:17 +0000
committerAndreas Bregas <ab@openoffice.org>2002-11-07 13:54:17 +0000
commit82ebe9bde3c1cde094f93452cf5b2747920b03fd (patch)
treefa5abeb4c82eacd9a0a55ac529a36203a031439a /stoc
parentdb0ada15c3d02163777bbb32db41043a7046559e (diff)
#104696# Call OUString::copy() only with valid length
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/inspect/introspection.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 7bf1ea8868e6..6325e3f4bc0c 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: introspection.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: ab $ $Date: 2002-08-26 14:44:48 $
+ * last change: $Author: ab $ $Date: 2002-11-07 14:54:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2718,7 +2718,8 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns
// Namen der potentiellen Property
sal_Int32 nStrLen = aMethName.getLength();
- OUString aEndStr = aMethName.copy( nStrLen - aListenerStr.getLength() );
+ sal_Int32 nCopyLen = nStrLen - aListenerStr.getLength();
+ OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 );
// Endet das Teil auf Listener?
// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
@@ -2746,7 +2747,9 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns
// Name holen und auswerten
OUString aMethName2 = rxMethod_k->getName();
- OUString aStartStr2 = aMethName2.copy( 0, 6 );
+ sal_Int32 nNameLen = aMethName2.getLength();
+ sal_Int32 nCopyLen = (nNameLen < 6) ? nNameLen : 6;
+ OUString aStartStr2 = aMethName2.copy( 0, nCopyLen );
OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) );
// ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!!
if( !( aStartStr2 == aRemoveStr ) )