Skip to content

Commit

Permalink
Avoid overflow in freetype/font_context.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwu committed Nov 16, 2015
1 parent f8c2c3c commit 7cbef87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/gfx/platform/freetype/font_context.rs
Expand Up @@ -57,7 +57,8 @@ extern fn ft_realloc(mem: FT_Memory, _cur_size: c_long, new_req_size: c_long,
let new_actual_size = heap_size_of(new_ptr);

let user = (*mem).user as *mut User;
(*user).size += new_actual_size - old_actual_size;
(*user).size += new_actual_size;
(*user).size -= old_actual_size;

new_ptr
}
Expand Down

0 comments on commit 7cbef87

Please sign in to comment.