bugThe FreeType Project - Bugs: bug #36833, NULL Pointer Dereference in...

 
 

bug #36833: NULL Pointer Dereference in FT_GlyphLoader_Prepare

Submitted by:  Mateusz Jurczyk <j00ru>
Submitted on:  Thu 12 Jul 2012 11:42:46 AM UTC  
 
Severity: 3 - NormalItem Group: Crash
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.11

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 18 Jul 2012 08:42:31 AM UTC, comment #1:

Fixed in git, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 12 Jul 2012 11:42:46 AM UTC, original submission:

Crash tested with ftbench, compiled under Ubuntu amd64 with AddressSanitizer (http://code.google.com/p/address-sanitizer/).

Log from AddressSanitizer:

--- cut ---
Program received signal SIGSEGV, Segmentation fault.
0x0000000000495de2 in FT_GlyphLoader_Prepare (loader=0x0) at freetype2/freetype-2.4.9/src/base/ftgloadr.c:312
312 current->outline.n_points = 0;
(gdb) where
#0 0x0000000000495de2 in FT_GlyphLoader_Prepare (loader=0x0) at freetype2/freetype-2.4.9/src/base/ftgloadr.c:312
#1 0x00000000005b123d in t1operator_seac (decoder=0x7fffffffce40, asb=92, adx=74907654, ady=-40, bchar=<optimized out>,
achar=<optimized out>) at freetype2/freetype-2.4.9/src/psaux/t1decode.c:291
#2 0x00000000005ac5ca in t1_decoder_parse_charstrings (decoder=<optimized out>, charstring_base=<optimized out>,
charstring_len=173) at freetype2/freetype-2.4.9/src/psaux/t1decode.c:1151
#3 0x00000000004e9384 in T1_Parse_Glyph_And_Get_Char_String (decoder=0x5c0669, glyph_index=26, char_string=<optimized out>)
at freetype2/freetype-2.4.9/src/type1/t1gload.c:93
#4 0x00000000004e8e9b in T1_Parse_Glyph (decoder=0x100000000000, glyph_index=7419453)
at freetype2/freetype-2.4.9/src/type1/t1gload.c:129
#5 0x00000000004eb774 in T1_Compute_Max_Advance (face=<optimized out>, max_advance=0x7ffff6b862f8)
at freetype2/freetype-2.4.9/src/type1/t1gload.c:197
#6 0x00000000004e425a in T1_Face_Init (stream=<optimized out>, t1face=0x7ffff6b86080, face_index=<optimized out>, num_params=0,
params=0x7fffffffce80) at freetype2/freetype-2.4.9/src/type1/t1objs.c:486
#7 0x000000000049a672 in open_face (driver=0x7ffff736e980, stream=0x7ffff7370080, face_index=0, num_params=0, params=0x0,
aface=0x7fffffffde20) at freetype2/freetype-2.4.9/src/base/ftobjs.c:1153
#8 0x000000000049946b in FT_Open_Face (library=0x7ffff6f86880, args=0x7fffffffdf20, face_index=0, aface=0x7fffffffe0a0)
at freetype2/freetype-2.4.9/src/base/ftobjs.c:2080
#9 0x0000000000498faa in FT_New_Face (library=0x62, pathname=<optimized out>, face_index=74907654, aface=0x100000000000)
at freetype2/freetype-2.4.9/src/base/ftobjs.c:1215
#10 0x00000000004907e4 in get_face (face=0x0) at freetype2/ft2demos-2.4.8/src/ftbench.c:624
#11 0x000000000049104d in main (argc=<optimized out>, argv=<optimized out>)
at freetype2/ft2demos-2.4.8/src/ftbench.c:752
(gdb) l
307 FT_GlyphLoader_Prepare( FT_GlyphLoader loader )
308 {
309 FT_GlyphLoad current = &loader->current;
310
311
312 current->outline.n_points = 0;
313 current->outline.n_contours = 0;
314 current->num_subglyphs = 0;
315
316 FT_GlyphLoader_Adjust_Points ( loader );
(gdb) x/10i $rip
=> 0x495de2 <FT_GlyphLoader_Prepare+50>: movw $0x0,0x62(%rbx)
0x495de8 <FT_GlyphLoader_Prepare+56>: lea 0x60(%rbx),%rdi
0x495dec <FT_GlyphLoader_Prepare+60>: mov %rdi,%rcx
0x495def <FT_GlyphLoader_Prepare+63>: shr $0x3,%rcx
0x495df3 <FT_GlyphLoader_Prepare+67>: or %rax,%rcx
0x495df6 <FT_GlyphLoader_Prepare+70>: mov (%rcx),%al
0x495df8 <FT_GlyphLoader_Prepare+72>: test %al,%al
0x495dfa <FT_GlyphLoader_Prepare+74>: je 0x495e07 <FT_GlyphLoader_Prepare+87>
0x495dfc <FT_GlyphLoader_Prepare+76>: mov %edi,%ecx
0x495dfe <FT_GlyphLoader_Prepare+78>: and $0x7,%ecx
(gdb) info reg
rax 0x100000000000 17592186044416
rbx 0x0 0
[...]
--- cut ---

Sample file attached.

Mateusz Jurczyk <j00ru>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26187:  FT_GlyphLoader_Prepare.bin added by j00ru (5KiB - application/octet-stream)

 

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 j00ru (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 18 Jul 2012 08:42:31 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.4.11
    Thu 12 Jul 2012 11:42:46 AM UTCj00ruAttached File-=>Added FT_GlyphLoader_Prepare.bin, #26187

    Back to the top


    Powered by Savane 3.1-cleanup1