bugThe FreeType Project - Bugs: bug #30054, buffer overflows in various tools...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #30054: buffer overflows in various tools (from freetype-demos)

Submitter:  Robert Swiecki <jagger>
Submitted:  Sat 05 Jun 2010 03:32:53 PM UTC
   
 
Severity:  3 - Normal Item Group:  Crash
Status:  Fixed Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  2.3.13

Mon 07 Jun 2010 10:01:35 PM UTC, comment #1: 

I've changed most of the %s to %.100s.  Thanks for the report.

Werner LEMBERG <wl>
Group administrator
Sat 05 Jun 2010 03:32:53 PM UTC, original submission:  

E.g. from ftview.c

static struct  status_
{
...
char           header_buffer[256];
...


in write_header( FT_Error  error_code )
{
...
sprintf( status.header_buffer, "File `%s': error 0x%04x",
                 basename, (FT_UShort)error_code );


with a long filename it produces on Linux with glibc

* buffer overflow detected *: /usr/local/fuzz/ttf/ftview terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7ffff71011d7]
/lib/libc.so.6(+0xfe090)[0x7ffff7100090]
/lib/libc.so.6(+0xfd4f9)[0x7ffff70ff4f9]
/lib/libc.so.6(_IO_default_xsputn+0xcc)[0x7ffff7077d1c]
/lib/libc.so.6(_IO_vfprintf+0x3d34)[0x7ffff704b0d4]
/lib/libc.so.6(__vsprintf_chk+0x99)[0x7ffff70ff599]
/lib/libc.so.6(__sprintf_chk+0x7f)[0x7ffff70ff4df]
/usr/local/fuzz/ttf/ftview[0x404ba0]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7ffff7020c4d]
/usr/local/fuzz/ttf/ftview[0x402849]


I recommend changing every sprintf into snprintf

Robert Swiecki <jagger>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by jagger (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-07 wl StatusNone Fixed
        Assigned toNone wl
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.3.13

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code