Branch: Tag:

2015-04-21

2015-04-21 09:20:57 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio.Buffer: Fixed integer overflow. Fixes [CID 1294563].

1408:    {    INT_TYPE ui = i->u.integer;    for( width=0; width<SIZEOF_INT_TYPE; width++ ) -  if( ui < (1<<(width*8)) && ui >= -(1<<(width*8-1)) ) +  if( ui < (((INT_TYPE)1)<<(width*8)) && +  ui >= -(((INT_TYPE)1)<<(width*8-1)) )    break;    io_add_int( THIS, width, len_width );    io_add_int( THIS, i->u.integer, width );