Bug 98889 - kword: crashes on RTF import
Summary: kword: crashes on RTF import
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Miscellaneous
Component: filters (show other bugs)
Version: 1.5 or before
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Ariya Hidayat
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 23:44 UTC by Ben Burton
Modified: 2006-04-27 11:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;
         }
     }