[Libreoffice-commits] .: Branch 'libreoffice-3-4-2' - sc/source
David Tardon
dtardon at kemper.freedesktop.org
Tue Jul 19 06:09:38 PDT 2011
sc/source/filter/excel/xestream.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit f325aecc07990198bf87943f3c59a4bfc1aa1ea6
Author: Muthu Subramanian <sumuthu at novell.com>
Date: Mon Jun 6 18:56:54 2011 +0530
Out-of-bounds array access fix. (Thanks to Fridrich too).
Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
Signed-off-by: David Tardon <dtardon at redhat.com>
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 319dfe1..5108c3c 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -861,10 +861,10 @@ OUString XclXmlUtils::ToOUString( const char* s )
OUString XclXmlUtils::ToOUString( const ScfUInt16Vec& rBuf, sal_Int32 nStart, sal_Int32 nLength )
{
- if( nLength == -1 )
- nLength = rBuf.size();
+ if( nLength == -1 || ( nLength > (rBuf.size() - nStart) ) )
+ nLength = (rBuf.size() - nStart);
- return OUString( &rBuf[nStart], nLength );
+ return (nLength > 0) ? OUString( &rBuf[nStart], nLength ) : OUString();
}
OUString XclXmlUtils::ToOUString( const String& s )
More information about the Libreoffice-commits
mailing list