On Mon, Aug 10, 2009 at 09:04:51PM +0100, Caroline Ford wrote:
> As test files I hadn't renamed from their open clip art originals!
Good! :) Users should be able to just drop whatever into their
~/.tuxpaint/starters/ directory (or wherever, on their particular OS),
and not have Tux Paint crash randomly. :)
Glad you caught it! (And glad it was us -- hence, fixable -- and not
the SVG libs under the hood.)
PS - FWIW, I ran "gdb tuxpaint" and then did a "bt" (backtrace) when it
crashed. I saw that something caught a strcpy() overflow, and that it
was inside do_new_dialog(). I realized it wasn't anything to do with the
buffers in the directory/thumbnail listing code, for two reasons:
(1) I saw, and could select the new starter from the New dialog;
it only crashed when I went to open it and start drawing
(2) Those buffers are handled via the dirent structure, which I just
assumed to be sane.
Once I noticed the "starter_id", I knew what happened. ;)
(32 is an ok buffer size for SAVED IMAGES, since they're named based
on a timestamp: YYYYMMDDHHMMSS.png. But, as I said, users should be able
to drop "i want to name this beautiful picture with a very long filename.png"
into their 'starters' folder. Nowhere did we ever say "32 chars long or
we'll crash and burn" in the user docs. ;^D )