bugThe FreeType Project - Bugs: bug #50578, Null pointer dereference in...

 
 

bug #50578: Null pointer dereference in cff_builder_init() if hinting is requested but not available

Submitted by:  Brian Nixon <bnixon>
Submitted on:  Sat 18 Mar 2017 06:03:07 PM UTC  
 
Severity: 3 - NormalItem Group: Crash
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.8

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 20 Mar 2017 11:57:13 AM UTC, comment #4:

Looks good; thanks!

Brian Nixon <bnixon>
Mon 20 Mar 2017 04:35:09 AM UTC, comment #3:

OK, I've committed a slightly different patch. Please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 19 Mar 2017 10:13:41 AM UTC, comment #2:

Dependency noted; really this was just about robustness. If I wilfully ignore the instructions then I understand that the library might not work properly – but should it crash?

(Compare ‛type1’, which also claims to need ‛pshinter’ but doesn’t crash if it’s not available.)

(And yes: if I’ve built without a hinter then I shouldn’t request rendering with hinting; the issue showed up testing such a build with ‛ftview’, which defaults hinting to on.)

Is there a real-world use case for such a configuration? I don’t know. Maybe as a drop-in replacement to run today’s clients on tomorrow’s ultra-high-resolution displays?

Brian Nixon <bnixon>
Sun 19 Mar 2017 04:42:24 AM UTC, comment #1:

Hmm. In both files `modules.cfg' and `INSTALL.any' it is explicitly mentioned that the `cff' module needs `pshinter'.

Please give more information.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 18 Mar 2017 06:03:07 PM UTC, original submission:

If FreeType is compiled without the pshinter module, and a caller requests hinting when loading a glyph from an OpenType face, cff_builder_init() crashes with a null pointer dereference.

Possible fix:

--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -281,7 +281,9 @@
CFF_Internal internal = (CFF_Internal)size->root.internal;

- builder->hints_globals = (void *)internal->topfont;
+ if ( internal )
+ builder->hints_globals = (void *)internal->topfont;
+
builder->hints_funcs = glyph->root.internal->glyph_hints;
}
}

Brian Nixon <bnixon>

 

(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 bnixon (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
    Mon 20 Mar 2017 04:35:09 AM UTCwlStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.8
    Sun 19 Mar 2017 04:42:24 AM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1