Bug 98889

Summary: kword: crashes on RTF import
Product: kword Reporter: Ben Burton <bab>
Component: filtersAssignee: Ariya Hidayat <ariya>
Status: RESOLVED FIXED    
Severity: crash CC: ana
Priority: NOR    
Version: 1.5 or before   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ben Burton 2005-02-08 23:44:49 UTC
Version:           1.3.5 (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

(Received through the debian BTS as #278646.)

A debian user reports that KWord crashes when importing a particular RTF file.  I can reproduce this also on my system.

The file is available as:

http://www.unicaen.fr/unicaen/essai/dossier_inscription_2004-2005.rtf

Thanks - Ben.
Comment 1 Fredrik Edemar 2005-04-14 18:10:20 UTC
CVS commit by fedemar: 

Don't crash when the parser is reading a sequence with "\brdrr\brdrwN". "\brdrr\brdrwN", "\brdrl\brdrwN", "\brdrt\brdrwN" and "\brdrb\brdrwN" should also work now.

BUG: 90649
BUG: 98889
BUG: 100949


  M +3 -2      rtfimport.cpp   1.134


--- koffice/filters/kword/rtf/import/rtfimport.cpp  #1.133:1.134
@@ -917,7 +917,8 @@ void RTFImport::setBorderStyle( RTFPrope
 void RTFImport::setBorderProperty( RTFProperty *property )
 {
+    //kdDebug() << "setBorderProperty: " << endl;
     if (state.layout.border)
     {
-        *((int *)(state.layout.border + property->offset)) = token.value;
+        state.layout.border->width = token.value;
     }
     else
@@ -925,5 +926,5 @@ void RTFImport::setBorderProperty( RTFPr
         for (uint i=0; i < 4; i++)
         {
-            *((int *)(((char *)&state.layout.borders[i]) + property->offset)) = token.value;
+            state.layout.borders[i].width = token.value;
         }
     }