Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 79233 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: openldap12
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-08 10:38 UTC by d.binderman
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-22 05:03:10 UTC


Attachments (Terms of Use)

Description d.binderman 2002-12-08 10:38:56 UTC
Description of Problem:

Hello there,

I just tried to compile package openldap12-1.2.13-5 from Redhat 8.0.

Here are some of the compiler messages.

ldapmodrdn.c:48: warning: operation on `myname' may be undefined

Here is a patch which fixes the messages.
 
*** ./clients/tools/ldapmodrdn.c.old	2002-11-18 12:51:44.000000000 +0000
--- ./clients/tools/ldapmodrdn.c	2002-11-18 12:53:01.000000000 +0000
***************
*** 45,51 ****
      not = contoper = verbose = remove = want_bindpw = debug = 0;
      authmethod = LDAP_AUTH_SIMPLE;
  
!     myname = (myname = strrchr(argv[0], '/')) == NULL ? argv[0] : ++myname;
  
      while (( i = getopt( argc, argv, "WkKcnvrh:p:D:w:d:f:" )) != EOF ) {
  	switch( i ) {
--- 45,58 ----
      not = contoper = verbose = remove = want_bindpw = debug = 0;
      authmethod = LDAP_AUTH_SIMPLE;
  
!     if ((myname = strrchr(argv[0], '/')) == NULL)
!     {
! 	myname = argv[0];
!     }
!     else
!     {
! 	++myname;
!     }
  
      while (( i = getopt( argc, argv, "WkKcnvrh:p:D:w:d:f:" )) != EOF ) {
  	switch( i ) {

Also, the compiler found

ldapsearch.c:477: warning: `tmpfd' might be used uninitialized in this function
ldapmodify.c:248: warning: `modop' might be used uninitialized in this function
ldapdelete.c:40: warning: `rc' might be used uninitialized in this function
ldapmodrdn.c:40: warning: `entrydn' might be used uninitialized in this function
ldapmodrdn.c:40: warning: `rdn' might be used uninitialized in this function
main.c:321: warning: `output_string' might be used uninitialized in this function
main.c:253: warning: `rc' might be used uninitialized in this function
main.c:253: warning: `matches' might be used uninitialized in this function
main.c:255: warning: `fi' might be used uninitialized in this function
rp500.c:60: warning: `rc' might be used uninitialized in this function
rp500.c:60: warning: `matches' might be used uninitialized in this function
rp500.c:67: warning: `fi' might be used uninitialized in this function
query.c:47: warning: `lfi' might be used uninitialized in this function
idl.c:329: warning: `rc' might be used uninitialized in this function
search.c:47: warning: `stoptime' might be used uninitialized in this function
search.c:436: warning: `filterarg_ptr' might be used uninitialized in this function
modrdn.c:35: warning: `old_rdn' might be used uninitialized in this function
attr.c:95: warning: `indexes' might be used uninitialized in this function
filterindex.c:101: warning: `idl' might be used uninitialized in this function
main.c:74: warning: `udp' might be used uninitialized in this function
value.c:114: warning: `rc' might be used uninitialized in this function
centipede.c:475: warning: `last' might be used uninitialized in this function
ldif.c:25: warning: `type' might be used uninitialized in this function

There seem to be 23 places where the compiler thinks there is a problem.



Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 John Thacker 2006-04-22 05:03:10 UTC
Not going to patch upstream code to quiet a compiler warning rather 
than fix a bug or error.


Note You need to log in before you can comment on or make changes to this bug.