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

 
 

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

Submitted by:  Robert Swiecki <jagger>
Submitted on:  Sat 05 Jun 2010 03:32:53 PM UTC  
 
Severity: 3 - NormalItem Group: Crash
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.13

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Jun 2010 10:01:35 PM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.13

    Back to the top


    Powered by Savane 3.1-cleanup