Hi,<br><br>you should check for the return of malloc also: due to the way png_read_row works it may be possible to write to some lower address in memory if a NULL is passed as the row argument.<br>Below is a gdb trace to clarify this.<br>
<br>As you can see, data is not written until row=0x2f928. This can be manipulated to write to some interesting lower place in memory (like the .got section). <br><br>(gdb) break png_read_row<br>Breakpoint 1 at 0xb7c5fee2: file pngread.c, line 580.<br>
(gdb) c<br>Continuing.<br>[Switching to Thread -1212070224 (LWP 27030)]<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x0, dsp_row=0x0) at pngread.c:580<br>580     pngread.c: No such file or directory.<br>        in pngread.c<br>
(gdb) c<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x5f25 <Address 0x5f25 out of bounds>, dsp_row=0x0) at pngread.c:580<br>580     in pngread.c<br>(gdb)<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0xbe4a <Address 0xbe4a out of bounds>, dsp_row=0x0) at pngread.c:580<br>
580     in pngread.c<br>(gdb)<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x11d6f <Address 0x11d6f out of bounds>, dsp_row=0x0) at pngread.c:580<br>580     in pngread.c<br>(gdb)<br>Continuing.<br>
<br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x17c94 <Address 0x17c94 out of bounds>, dsp_row=0x0) at pngread.c:580<br>580     in pngread.c<br>(gdb)<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x1dbb9 <Address 0x1dbb9 out of bounds>, dsp_row=0x0) at pngread.c:580<br>
580     in pngread.c<br>(gdb)<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x23ade <Address 0x23ade out of bounds>, dsp_row=0x0) at pngread.c:580<br>580     in pngread.c<br>(gdb)<br>Continuing.<br>
<br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x29a03 <Address 0x29a03 out of bounds>, dsp_row=0x0) at pngread.c:580<br>580     in pngread.c<br>(gdb)<br>Continuing.<br><br>Breakpoint 1, png_read_row (png_ptr=0x80528d8, row=0x2f928 <Address 0x2f928 out of bounds>, dsp_row=0x0) at pngread.c:580<br>
580     in pngread.c<br>(gdb) c<br>Continuing.<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0xb7c57b33 in png_combine_row (png_ptr=0x80528d8, row=0x2f928 <Address 0x2f928 out of bounds>, mask=128) at pngrutil.c:2483<br>
2483    pngrutil.c: No such file or directory.<br>        in pngrutil.c<br>(gdb)<br><br>Regards,<br>Thomas Pollet<br><br><div><span class="gmail_quote">On 09/04/2008, <b class="gmail_sendername">Michael Sweet</b> <<a href="mailto:msweet@apple.com">msweet@apple.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
[STR Closed w/Resolution]<br> <br> Fixed in Subversion repository.<br> <br> Link: <a href="http://www.cups.org/str.php?L2790">http://www.cups.org/str.php?L2790</a><br> Version: 1.3-current<br> Fix Version: 1.4-current<br>
</blockquote></div><br>