Bug 168 - Preview kill application
Bug#: 168 Product:  i.Scribe/InScribe Version: v1.90 test1 Platform: PC
OS/Version: Windows XP Status: RESOLVED Severity: critical Priority: P1
Resolution: FIXED Assigned To: fret@memecode.com Reported By: bonk@karneval.cz
Component: HTML Plugin
Summary: Preview kill application
Opened: 2007-10-22 19:51
Description:   Opened: 2007-10-22 19:51
I have recieved a (bad) mail witch kill an application. I found a problem with
preview an email. When I switch off the preview than I can use I.scribe. 
I can send you folders.mail2 where is only this mail. It is about 8kb in zip

------- Comment #1 From Bronis 2007-10-22 20:03:00 -------
Created an attachment (id=38) [details]
this is file with bug

------- Comment #2 From Matthew Allen 2007-10-22 23:12:23 -------
This is mail2 folder you sent me a week or two ago?

I had a look at this and its a very badly formed HTML email with hundreds of
<body> tags. The problem is that Scribe is using a recursive algorithm to parse
the HTML and it runs out of stack space and crashs. On normal well formed email
it doesn't have a problem. I've been reviewing my options on the best way to
fix it. The 2 that come to mind are making the algorithm use a heap based
structure and not the stack (lots of work) or just detect zillions of nested
tags and quit out after a certain depth (easy).

------- Comment #3 From Matthew Allen 2007-10-23 00:22:40 -------
This is fixed for v1.90-test1.

I've limited the depth of recursion to 1024 levels. After that it bails out of
parsing the HTML. Any document parsed before that point will be displayed.