From: Julien B. <jb...@jb...> - 2003-11-06 14:41:23
|
Hi, I've just fixed a heap corruption in TiLP, and I had to run Valgrind on TiLP to find it. This reveals a lot of errors related to string handling ; most of the time TiLP is reading past the end of a buffer, but from time to time it's *WRITING* past the end of the buffer, which is a real problem. The problem I fixed was lying in the format() function in src/labels.c. This function is called with a buffer returned by a GTK function as its argument, and *modifies* this buffer. Eventually, it can write past the end of the buffer. How bad that is. I wonder if the GTK docs aren't explicite enough when they tell *not to modify a buffer returned by a GTK function*... If somebody has more free time than I actually do, it'd be nice to run TiLP under Valgrind and fix the errors... For a (colored) diff, see : <http://svn.technologeek.org/cgi-bin/viewcvs.cgi/tilp/trunk/src/labels.c?r1=338&r2=357&diff_format=h&root=tilp> JB. -- Julien BLACHE <http://www.jblache.org> <jb...@jb...> |