[389-devel] Re: Sign compare checking

2016-08-30 Thread Howard Chu
Date: Mon, 29 Aug 2016 11:43:27 -0600 From: Rich Megginson <rmegg...@redhat.com> Subject: [389-devel] Re: Sign compare checking To: 389-devel@lists.fedoraproject.org Message-ID: <a7fdb987-8efa-d26d-08c1-3cf0ecb59...@redhat.com> Content-Type: multipart/alternati

[389-devel] Re: Sign compare checking

2016-08-29 Thread William Brown
> > > > int ber_printf(BerElement *ber, const char *fmt, ...); > > > > lber.h:79:#define LBER_ERROR((ber_tag_t) -1) > > > > We check if (ber_printf(...) != LBER_ERROR) > > > > Of course, we can't satisfy either. We can't cast the LBER_ERROR from > > uint -> int without changing the

[389-devel] Re: Sign compare checking

2016-08-29 Thread Rich Megginson
On 08/28/2016 11:13 PM, William Brown wrote: So either, this is a bug in the way openldap uses the ber_len_t type, we have a mistake in our logic, or something else hokey is going on. I would like to update this to: if ( (tag != LBER_END_OF_SEQORSET) && (len == 0) && (*fstr != NULL) ) Or

[389-devel] Re: Sign compare checking

2016-08-28 Thread William Brown
> > So either, this is a bug in the way openldap uses the ber_len_t type, we > have a mistake in our logic, or something else hokey is going on. > > I would like to update this to: > > if ( (tag != LBER_END_OF_SEQORSET) && (len == 0) && (*fstr != NULL) ) > > Or even: > > if ( (tag !=