On Fri, May 30, 2008 at 10:51:33PM +0000, corvid wrote:
Jorge wrote:
On Thu, May 29, 2008 at 09:15:24PM +0000, corvid wrote:
Jorge wrote:
On Thu, May 29, 2008 at 08:49:22PM +0000, corvid wrote:
Jorge wrote:
Just committed this patch. It makes things like:
http://separat-lib.narod.ru/master.txt
work.
Why now? I don't understand the motivation for this.
My next patch is just going to rip it out again because it will become unnecessary.
Yeah, I noticed it could happen after making the patch, but a segfault on that page made me fix and commit it.
Why did it make plain segfault?
The patch is attached for you to review in detail.
The relevant part is an:
Start_Ofs += i - len;
substituted by a:
Buf_Consumed = BufSize - len;
(if the length of a long line got bigger than 'i', 'i - len' was negative. A strange case triggered by that page, that has really long lines).
How did len get bigger than i? I tried the page yesterday without being able to get a crash. And now I've saved it locally and changed file.dpi to send it 200 bytes at a time, which gives me a long series of normal values when lines get bigger than packets:
.. i-len 76 i-len 0 i-len 273 i-len 112 i-len 183 i-len 91 i-len 0 i-len 0 i-len 389 i-len 101 i-len 0 i-len 182 i-len 0 i-len 0 ..
Well, it took me some time to reproduce it again... The attached patch is what I've got when adding the decoder over the old code. It works most of the time, but if you go to: http://separat-lib.narod.ru/master.txt It will segfault with a Start_Ofs > BufSize. Note: the patch is against current CVS. -- Cheers Jorge.-