Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
pen->num_vertices = 
  _cairo_pen_vertices_needed(
    gstate->tolerance, 
    radius, 
    &gstate->ctm
  );
pen->vertices = 
  malloc(pen->num_vertices * sizeof(cairo_pen_vertex_t));

...

Code Block
bgColor#ccccff
pen->num_vertices = 
  _cairo_pen_vertices_needed(
    gstate->tolerance, 
    radius, 
    &gstate->ctm
  );

if (pen->num_vertices > SIZE_MAX/sizeof(cairo_pen_vertex_t)) {
   /* handle error condition */
}
pen->vertices = malloc(pen->num_vertices * sizeof(cairo_pen_vertex_t));

...

Code Block
bgColor#ccccff
unsigned int ui1, ui2, uresult;

if ( (ui2 >= sizeof(unsigned int)*CHAR_BIT) 
  || (ui1 > (UINT_MAX  >> ui2))) ) 
{
  /* handle error condition */
}
else {
  uresult = ui1 << ui2;
}

...