[cff, cid] Fix segfaults in case of error (#58621).

* src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c
(cid_slot_done): If `ft_glyphslot_init' fails to allocate
`internal', then the class' `done_slot' callback (called by
`ft_glyphslot_done') must not dereference the pointer to `internal'.
GSoC-2020-greg
Sebastian Rasmussen 5 years ago committed by Werner Lemberg
parent d1180b5f95
commit 8ed5a2477e
  1. 9
      ChangeLog
  2. 3
      src/cff/cffobjs.c
  3. 3
      src/cid/cidobjs.c

@ -1,3 +1,12 @@
2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
[cff, cid] Fix segfaults in case of error (#58621).
* src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c
(cid_slot_done): If `ft_glyphslot_init' fails to allocate
`internal', then the class' `done_slot' callback (called by
`ft_glyphslot_done') must not dereference the pointer to `internal'.
2020-06-19 Werner Lemberg <wl@gnu.org>
[base] Fix UBSAN error.

@ -352,7 +352,8 @@
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
{
slot->internal->glyph_hints = NULL;
if ( slot->internal )
slot->internal->glyph_hints = NULL;
}

@ -49,7 +49,8 @@
FT_LOCAL_DEF( void )
cid_slot_done( FT_GlyphSlot slot )
{
slot->internal->glyph_hints = NULL;
if ( slot->internal )
slot->internal->glyph_hints = NULL;
}

Loading…
Cancel
Save