[BUGS] potential integer overflow in md.c

2007-04-04 Thread Zdenek Kotala
I found following expression in md.c: seekpos = (long) (BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE))); all variables and constants are int (32-bit) and long (also very often 32-bit). In case when somebody want to change RELSEG_SIZE to value related to 4GB and bigger chunk he can expect d

Re: [BUGS] potential integer overflow in md.c

2007-04-04 Thread Tom Lane
Zdenek Kotala <[EMAIL PROTECTED]> writes: > I found following expression in md.c: > seekpos = (long) (BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE))); There's no percentage in touching that code unless you intend to enable the non-segmented behavior; which will probably need more fixes than j

Re: [BUGS] potential integer overflow in md.c

2007-04-04 Thread Zdenek Kotala
Tom Lane wrote: Zdenek Kotala <[EMAIL PROTECTED]> writes: I found following expression in md.c: seekpos = (long) (BLCKSZ * (blocknum % ((BlockNumber) RELSEG_SIZE))); There's no percentage in touching that code unless you intend to enable the non-segmented behavior; which will probably need m