[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    crash #44514
From:       John Dailey <dailey () vt ! edu>
Date:       2002-08-31 1:46:08
[Download RAW message or body]

Ariya, you closed this saying you couldn't reproduce it but I could on my 
machine.  It might have to do with the amount of system resources.  Basically 
the problem is that the koscript parser will choke and die if you send it an 
enourmous string.  This patch is a bit of a hack but solves the problem -- 
ignore setting the cell to a string that is too long.

Any ideas on a better arbitrary constant to put here?  5000 is probably far 
higher than it needs to be but still provides enough protection.  I think 
it's safe to assume that if the user is pasting in more than 5000 characters, 
the clipboard didn't have what they thought it had in it.

-John
["largetext.diff" (text/x-diff)]

Index: kspread_cell.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_cell.cc,v
retrieving revision 1.445
diff -p -u -3 -r1.445 kspread_cell.cc
--- kspread_cell.cc	2002/08/30 03:50:26	1.445
+++ kspread_cell.cc	2002/08/31 01:29:54
@@ -3313,6 +3313,9 @@ void KSpreadCell::decPrecision()
 
 void KSpreadCell::setCellText( const QString& _text, bool updateDepends )
 {
+  if (_text.length() > 5000)
+    return;
+
     QString oldText=m_strText;
     setDisplayText( _text, updateDepends );
     if(!m_pTable->isLoading() && !testValidity() )

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic