Re: [ovs-dev] [PATCH] lib/util: Input validation in str_to_uint

2014-04-23 Thread Zoltan Kiss
On 22/04/14 22:39, Ben Pfaff wrote: On Tue, Apr 22, 2014 at 06:27:18PM +0100, Zoltan Kiss wrote: This function returns true when 's' is negative or greater than UINT_MAX. Also, the representation of 'int' and 'unsigned int' is implementation dependent, so converting [INT_MAX..UINT_MAX] values wi

Re: [ovs-dev] [PATCH] lib/util: Input validation in str_to_uint

2014-04-22 Thread Ben Pfaff
On Tue, Apr 22, 2014 at 06:27:18PM +0100, Zoltan Kiss wrote: > This function returns true when 's' is negative or greater than UINT_MAX. > Also, > the representation of 'int' and 'unsigned int' is implementation dependent, so > converting [INT_MAX..UINT_MAX] values with str_to_int is fragile. > In

[ovs-dev] [PATCH] lib/util: Input validation in str_to_uint

2014-04-22 Thread Zoltan Kiss
This function returns true when 's' is negative or greater than UINT_MAX. Also, the representation of 'int' and 'unsigned int' is implementation dependent, so converting [INT_MAX..UINT_MAX] values with str_to_int is fragile. Instead, we should convert straight to 'long long' and do a boundary check