Skip to content

Commit

Permalink
Bug 592484 - invalid write in HB
Browse files Browse the repository at this point in the history
Fix off-by-one.
  • Loading branch information
behdad committed Nov 2, 2009
1 parent b614b00 commit f0c7540
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hb-ot-layout.cc
Expand Up @@ -226,8 +226,8 @@ _hb_ot_layout_set_glyph_class (hb_face_t *face,
unsigned char *new_klasses;

new_len = len == 0 ? 120 : 2 * len;
if (new_len > 65535)
new_len = 65535;
if (new_len > 65536)
new_len = 65536;
new_klasses = (unsigned char *) realloc (layout->new_gdef.klasses, new_len * sizeof (unsigned char));

if (HB_UNLIKELY (!new_klasses))
Expand Down

0 comments on commit f0c7540

Please sign in to comment.