Re: howmany macro: integer overflow

2014-06-17 Thread Tobias Stoeckmann
On Wed, Jun 18, 2014 at 08:20:16AM +0200, Alexander Hall wrote: > >RCS file: /cvs/src/sys/sys/param.h,v > > Where else could howmany come from? Can you be sure it's safe to use here? There are other places where howmany is defined, I can prepare a diff that will cover all definitions. For now, I

Re: howmany macro: integer overflow

2014-06-17 Thread Alexander Hall
On June 14, 2014 1:13:56 PM CEST, Tobias Stoeckmann wrote: >Hi, > >the howmany macro as used in param.h and select.h is prone to an >integer >overflow. It adds divisor-1 to the base value, which means that it >COULD overflow. > >Most of the times, the howmany macro is used with file descriptor

Re: howmany macro: integer overflow

2014-06-14 Thread sven falempin
On Sat, Jun 14, 2014 at 7:13 AM, Tobias Stoeckmann wrote: > Hi, > > the howmany macro as used in param.h and select.h is prone to an integer > overflow. It adds divisor-1 to the base value, which means that it > COULD overflow. > > Most of the times, the howmany macro is used with file descripto

howmany macro: integer overflow

2014-06-14 Thread Tobias Stoeckmann
Hi, the howmany macro as used in param.h and select.h is prone to an integer overflow. It adds divisor-1 to the base value, which means that it COULD overflow. Most of the times, the howmany macro is used with file descriptors and polling, would be hard to overflow it. Especially due to C langu