Hi Jorge !
The following line is reallocating a buffer: conn->Buf = g_realloc(conn->Buf, (gulong)io->Status);
But when debugging the values of io->Status don't seem to be adequate. I haven't been able to completely fix it as the code is seriously lacking of comment.
All the dpi stuff is under a big revision. The current diff I'm working on is 40 pages. BTW, in the new version, that line is:
conn->Buf = g_realloc(conn->Buf, conn->BufSize + (gulong)io->Status);
That is what i had first done to fix the problem. But dillo still segfault a bit later and i've not been able to found where yet. I can just say that there is a problem with the start of a string that is lost somewhere. IMHO the fix of Roberto looks better but as i'm not used to this code i'm maybe wrong.
To be honest i don't even completely understand what this chunk is doing and the code is so unreadable that it doesn't help (not to be harsh but just to give my humble opinion).
:-O
This is meant to be a constructive critic. I'm addicted to maintainable code and by experience i know that if there are not enough comments the code is not easily readable. For the record, this bug has been found month ago but i've been unmotivated each time i had to read again the dpi.c file. If it had been well commented i should have been able to fix the problem by myself and to send you the resulting patch. Think that you have maybe lost potential developers just for this reason. Now and again this is just my humble opinion and i'm not pretensious enough to try to learn you how to manage your own project. Cheers, Damien