CRevString overflow
Status: Beta
Brought to you by:
thelivingone
I was converting an RTF file with lots of font changes; this caused a segmentation error, due to a buffer overflow in a CRevString (closingtags). As a temporary workaround, I just increased the buffer size in gstring.h from 256 to 4096, but surely, there is a more appropriate and robust way to deal with this issue.
I am also wondering if perhaps successive font changes should trigger the closing of the previous SPAN tag, instead of opening an ever increasing number of nested SPANs, which seems to have been at the root of the problem that I ran into.
> I am also wondering if perhaps successive font changes should trigger the closing of the previous SPAN tag,
That's pretty hard to implement with the approach used in the lib - it does not rebuild whole document structure in memory but just changes RTF tags to HTML. So if an RTF writer created hundred of nested tags then resulting HTML will also have a hundred of nested tags.