openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msei...@apache.org
Subject svn commit: r1845330 - /openoffice/trunk/main/tools/source/string/strimp.cxx
Date Wed, 31 Oct 2018 13:39:30 GMT
Author: mseidel
Date: Wed Oct 31 13:39:29 2018
New Revision: 1845330

URL: http://svn.apache.org/viewvc?rev=1845330&view=rev
Log:
Applying strimp.patch

Modified:
    openoffice/trunk/main/tools/source/string/strimp.cxx

Modified: openoffice/trunk/main/tools/source/string/strimp.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/tools/source/string/strimp.cxx?rev=1845330&r1=1845329&r2=1845330&view=diff
==============================================================================
--- openoffice/trunk/main/tools/source/string/strimp.cxx (original)
+++ openoffice/trunk/main/tools/source/string/strimp.cxx Wed Oct 31 13:39:29 2018
@@ -1148,7 +1148,10 @@ STRING& STRING::ConvertLineEnd( LineEnd
 		// Bei \r oder \n gibt es neuen Zeilenumbruch
 		if ( (pStr[i] == _CR) || (pStr[i] == _LF) )
 		{
-			nLen = nLen + nLineEndLen;
+			if( nLen <= STRING_MAXLEN - nLineEndLen )
+				nLen = nLen + nLineEndLen;
+			else
+				nLen = STRING_MAXLEN;
 
 			// Wenn schon gesetzt, dann brauchen wir keine aufwendige Abfrage
 			if ( !bConvert )
@@ -1169,7 +1172,10 @@ STRING& STRING::ConvertLineEnd( LineEnd
 				++i;
 		}
 		else
-			++nLen;
+		{
+			if( nLen < STRING_MAXLEN )
+			    ++nLen;
+		}
 		++i;
 
 		// Wenn String zu lang, dann konvertieren wir nicht



Mime
View raw message