teambob / docfrac

DocFrac is a document converter that can convert between RTF, HTML and ASCII text. This includes RTF to HTML and HTML to RTF. Supports text formatting (e.g. bold); tables; and most European languages. Available for Windows; Linux; ActiveX and DLL.
GNU General Public License v2.0
13 stars 6 forks source link

[Bug] Rtf2Text crash on coloring [sf#15] #15

Closed teambob closed 9 years ago

teambob commented 9 years ago

Reported by edmondm on 2006-08-30 19:22 UTC RtfStyle has a nasty bug in the method setForegroundColour()

The developer decided to check on the index of the color to the size of the table, but someone forgot that the size of the table could be 0, so assuming that the table is populated, they go ahead and check and check the index of that table.

There should be a condition check that if (redTable->size() != 0) { ....continue

This caused a segmentation fault on Linux, and we added this code to get it working

teambob commented 9 years ago

Commented by andrewpunch on 2006-10-08 03:18 UTC Logged In: YES user_id=928005

The index should never reference a non-existent table entry (in theory). However since the index value comes from the RTF file itself it may refer to an empty table (as mentioned here) or to an element which is not contained in the table.

This could be achieved in one of the following ways:

Other changes:

teambob commented 9 years ago

Updated by andrewpunch on 2006-10-08 03:18 UTC

teambob commented 9 years ago

Commented by andrewpunch on 2006-10-15 13:16 UTC Logged In: YES user_id=928005

This entire section has been refactored:

Still need to create a Log class to handle any problems that may arise.

teambob commented 9 years ago

Updated by andrewpunch on 2006-11-11 23:15 UTC