If you repeatedly paste something, AbiWord tends to eventually segfault.  
That's not cool at all.  I think this is because the buffer is allocated
with one byte too little: no memory is allocated for the trailing zero.  
Here's a patch to ie_exp::writeFile.

pat

Index: src/wp/impexp/xp/ie_exp.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_exp.cpp,v
retrieving revision 1.37
diff -u -r1.37 ie_exp.cpp
--- src/wp/impexp/xp/ie_exp.cpp 2001/03/29 17:37:02     1.37
+++ src/wp/impexp/xp/ie_exp.cpp 2001/04/09 01:22:24
@@ -236,8 +237,13 @@

        m_pDocRange = pDocRange;
        m_pByteBuf = pBuf;
+
+       UT_Error err = _writeDocument();
+
+       // write trailing zero to byte buffer (not required for file)
+       write("",1);

-       return _writeDocument();
+       return err;
 }

 //////////////////////////////////////////////////////////////////



Reply via email to