Issue 4331 - variable used before set in servers/slapd/syncrepl.c
Summary: variable used before set in servers/slapd/syncrepl.c
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 19:59 UTC by fenlason@redhat.com
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description fenlason@redhat.com 2006-01-11 19:59:45 UTC
Full_Name: Jay Fenlason
Version: 2.3.17
OS: Linux
URL: 
Submission from: (NULL) (66.187.230.200)


I was going through our bugzilla closing old OpenLDAP bugs when I found
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=160138
To my suprise, that code is still in 2.3.17, and is clearly broken.  "newp" is
not set in any way before the dn_match call.  I would guess that the match is
supposed to be against "nnewp", but I don't understand the code enough to be
sure.

Comment 1 ando@openldap.org 2006-01-11 20:23:59 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 ando@openldap.org 2006-01-11 20:33:31 UTC
> I was going through our bugzilla closing old OpenLDAP bugs when I found
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=160138
> To my suprise, that code is still in 2.3.17, and is clearly broken.  "newp"
is
> not set in any way before the dn_match call.  I would guess that the match is
> supposed to be against "nnewp", but I don't understand the code enough to be
> sure.

Correct, good catch.  Yes, the test was clearly supposed to be for nnewp, which
contains the normalized parent's DN, so the comparison reduces to a memcmp();
then the pretty form in newp is used to propagate the operation.

Fixed in HEAD; thanks, p.
Comment 3 fenlason@redhat.com 2006-01-11 21:07:46 UTC
On Wed, Jan 11, 2006 at 08:33:31PM +0000, Pierangelo Masarati wrote:
> > I was going through our bugzilla closing old OpenLDAP bugs when I found
> > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=160138
> > To my suprise, that code is still in 2.3.17, and is clearly broken.  "newp"
> is
> > not set in any way before the dn_match call.  I would guess that the match is
> > supposed to be against "nnewp", but I don't understand the code enough to be
> > sure.
> 
> Correct, good catch.  Yes, the test was clearly supposed to be for nnewp, which
> contains the normalized parent's DN, so the comparison reduces to a memcmp();
> then the pretty form in newp is used to propagate the operation.
> 
> Fixed in HEAD; thanks, p.

I'm looking through all the warning messages generated when I build
2.3.17.  Expect another bug report when I've gone through them all.
Most of them are "warning: too many arguments for format" because of
the Debug macro (I think), but a few of them look like they might be
real.

			-- JF

Comment 4 ando@openldap.org 2006-01-11 23:24:12 UTC
On Wed, 2006-01-11 at 21:07 +0000, fenlason@redhat.com wrote:

> I'm looking through all the warning messages generated when I build
> 2.3.17.  Expect another bug report when I've gone through them all.
> Most of them are "warning: too many arguments for format" because of
> the Debug macro (I think),

Right, you may (safely?) ignore them; they will eventually disappear as
logging gets redesigned.

> but a few of them look like they might be
> real.

In my builds, apart from few mostly useless modules all warnings are
"too many args" or "type punned/strict aliasing" stuff (gcc 3.4.4 -Wall
-Wextra -pedantic).

If you find anything else, please report.  Thanks, p.




Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it
------------------------------------------

Comment 5 fenlason@redhat.com 2006-01-12 17:03:22 UTC
On Thu, Jan 12, 2006 at 12:24:12AM +0100, Pierangelo Masarati wrote:
> On Wed, 2006-01-11 at 21:07 +0000, fenlason@redhat.com wrote:
> 
> > I'm looking through all the warning messages generated when I build
> > 2.3.17.  Expect another bug report when I've gone through them all.
> > Most of them are "warning: too many arguments for format" because of
> > the Debug macro (I think),
> 
> Right, you may (safely?) ignore them; they will eventually disappear as
> logging gets redesigned.
> 
> > but a few of them look like they might be
> > real.
> 
> In my builds, apart from few mostly useless modules all warnings are
> "too many args" or "type punned/strict aliasing" stuff (gcc 3.4.4 -Wall
> -Wextra -pedantic).
> 
> If you find anything else, please report.  Thanks, p.

All the real  used-before-set errors are in the bdb part of the build, so
not your problem.  I did notice:

../../../libraries/libldap/tls.c: In function 'tls_get_cert':
../../../libraries/libldap/tls.c:879: warning: implicit declaration of function 'ssl3_send_alert'

This looks like it's using an openssl internal function, which is
probably a no-no.

../../../libraries/libldap/test.c: In function 'get_modlist':
../../../libraries/libldap/test.c:172: warning: 'tmp.mod_op' may be used uninitialized in this function

This looks like it could be real, but it looks like test code.  The
easy solution would be to bzero (erm memset) the structure before the
loop.

../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_set_concurrency':
../../../libraries/libldap_r/thr_posix.c:58: warning: implicit declaration of function 'pthread_setconcurrency'
../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_get_concurrency':
../../../libraries/libldap_r/thr_posix.c:72: warning: implicit declaration of function 'pthread_getconcurrency'
../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_kill':
../../../libraries/libldap_r/thr_posix.c:174: warning: implicit declaration of function 'pthread_kill'

I think these are actually "bugs" in the pthread header files.  I
can't find a declaration for pthread_kill() anywhere, although it has
a man page.  The others don't have man pages, and the declarations are
hidden behind an #ifdef.

			-- JF

Comment 6 Kurt Zeilenga 2006-01-12 17:20:46 UTC
Please report this separately from the syncrepl issue.

At 09:03 AM 1/12/2006, fenlason@redhat.com wrote:
>On Thu, Jan 12, 2006 at 12:24:12AM +0100, Pierangelo Masarati wrote:
>> On Wed, 2006-01-11 at 21:07 +0000, fenlason@redhat.com wrote:
>> 
>> > I'm looking through all the warning messages generated when I build
>> > 2.3.17.  Expect another bug report when I've gone through them all.
>> > Most of them are "warning: too many arguments for format" because of
>> > the Debug macro (I think),
>> 
>> Right, you may (safely?) ignore them; they will eventually disappear as
>> logging gets redesigned.
>> 
>> > but a few of them look like they might be
>> > real.
>> 
>> In my builds, apart from few mostly useless modules all warnings are
>> "too many args" or "type punned/strict aliasing" stuff (gcc 3.4.4 -Wall
>> -Wextra -pedantic).
>> 
>> If you find anything else, please report.  Thanks, p.
>
>All the real  used-before-set errors are in the bdb part of the build, so
>not your problem.  I did notice:
>
>../../../libraries/libldap/tls.c: In function 'tls_get_cert':
>../../../libraries/libldap/tls.c:879: warning: implicit declaration of function 'ssl3_send_alert'
>
>This looks like it's using an openssl internal function, which is
>probably a no-no.
>
>../../../libraries/libldap/test.c: In function 'get_modlist':
>../../../libraries/libldap/test.c:172: warning: 'tmp.mod_op' may be used uninitialized in this function
>
>This looks like it could be real, but it looks like test code.  The
>easy solution would be to bzero (erm memset) the structure before the
>loop.
>
>../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_set_concurrency':
>../../../libraries/libldap_r/thr_posix.c:58: warning: implicit declaration of function 'pthread_setconcurrency'
>../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_get_concurrency':
>../../../libraries/libldap_r/thr_posix.c:72: warning: implicit declaration of function 'pthread_getconcurrency'
>../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_kill':
>../../../libraries/libldap_r/thr_posix.c:174: warning: implicit declaration of function 'pthread_kill'
>
>I think these are actually "bugs" in the pthread header files.  I
>can't find a declaration for pthread_kill() anywhere, although it has
>a man page.  The others don't have man pages, and the declarations are
>hidden behind an #ifdef.
>
>                        -- JF

Comment 7 ando@openldap.org 2006-01-12 17:22:45 UTC
On Thu, 2006-01-12 at 12:03 -0500, Jay Fenlason wrote:

> All the real  used-before-set errors are in the bdb part of the build, so
> not your problem.  I did notice:
> 
> ../../../libraries/libldap/tls.c: In function 'tls_get_cert':
> ../../../libraries/libldap/tls.c:879: warning: implicit declaration of function 'ssl3_send_alert'
> 
> This looks like it's using an openssl internal function, which is
> probably a no-no.

^^^ this has already been discussed in the past; I do not recall the
exact reason (and I'm too lazy to look it up in the archives) but yes,
it's calling an internal for something that has to be done that way.
Call it a "limitation" of ssl API...

> 
> ../../../libraries/libldap/test.c: In function 'get_modlist':
> ../../../libraries/libldap/test.c:172: warning: 'tmp.mod_op' may be used uninitialized in this function
> 
> This looks like it could be real, but it looks like test code.  The
> easy solution would be to bzero (erm memset) the structure before the
> loop.

right; but ll in all it's a harmless test.

> 
> ../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_set_concurrency':
> ../../../libraries/libldap_r/thr_posix.c:58: warning: implicit declaration of function 'pthread_setconcurrency'
> ../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_get_concurrency':
> ../../../libraries/libldap_r/thr_posix.c:72: warning: implicit declaration of function 'pthread_getconcurrency'
> ../../../libraries/libldap_r/thr_posix.c: In function 'ldap_pvt_thread_kill':
> ../../../libraries/libldap_r/thr_posix.c:174: warning: implicit declaration of function 'pthread_kill'
> 
> I think these are actually "bugs" in the pthread header files.  I
> can't find a declaration for pthread_kill() anywhere, although it has
> a man page.  The others don't have man pages, and the declarations are
> hidden behind an #ifdef.

Right.

Thanks, p.




Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it
------------------------------------------

Comment 8 Kurt Zeilenga 2006-01-17 19:22:05 UTC
changed notes
changed state Test to Release
Comment 9 Kurt Zeilenga 2006-01-17 22:54:12 UTC
changed state Release to Closed
Comment 10 Howard Chu 2009-02-17 05:17:20 UTC
moved from Software Bugs to Archive.Software Bugs
Comment 11 OpenLDAP project 2014-08-01 21:06:42 UTC
fixed in HEAD/re23