Re: ldapd warning

2020-11-29 Thread Florian Obser
On Sun, Nov 29, 2020 at 08:41:50AM +0100, Theo Buehler wrote: > On Sun, Nov 29, 2020 at 08:02:45AM +0100, Emil Engler wrote: > > It can overflow! Please check for the positivity and width of size_t before! > > What can overflow? ret is guaranteed to be non-negative before the cast. > > As for

Re: ldapd warning

2020-11-29 Thread Florian Obser
On Sun, Nov 29, 2020 at 06:42:47PM +1000, Jonathan Matthew wrote: > On Sat, Nov 28, 2020 at 11:20:30PM +0100, Theo Buehler wrote: > > /usr/src/usr.sbin/ldapd/util.c:46:21: warning: comparison of integers of > > different signs: > > 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] >

Re: ldapd warning

2020-11-29 Thread Jonathan Matthew
On Sat, Nov 28, 2020 at 11:20:30PM +0100, Theo Buehler wrote: > /usr/src/usr.sbin/ldapd/util.c:46:21: warning: comparison of integers of > different signs: > 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] > if (ret < 0 || ret >= size) >~~~ ^

Re: ldapd warning

2020-11-28 Thread Theo Buehler
On Sun, Nov 29, 2020 at 08:02:45AM +0100, Emil Engler wrote: > It can overflow! Please check for the positivity and width of size_t before! What can overflow? ret is guaranteed to be non-negative before the cast. As for the width (which would be about truncation, not overflow): while the

Re: ldapd warning

2020-11-28 Thread Emil Engler
It can overflow! Please check for the positivity and width of size_t before! Cheers, Emil On 11/28/20 11:20 PM, Theo Buehler wrote: /usr/src/usr.sbin/ldapd/util.c:46:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]

ldapd warning

2020-11-28 Thread Theo Buehler
/usr/src/usr.sbin/ldapd/util.c:46:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] if (ret < 0 || ret >= size) ~~~ ^ This has been around for a while. I forgot that I had this patch in my