Bug 110899 - bad source code
bad source code
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: netatalk (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Charlie Bennett
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-25 07:30 EST by d.binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: FC2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-07-26 16:49:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-11-25 07:30:28 EST
Description of problem:

I just tried to compile package netatalk-1_5_5-9 from Fedora.

The compiler said

1.

ad_lock.c(269): warning #187: use of "=" where "==" may have been 
intended

The source code is

  if ((lock.l_type = F_RDLCK) &&

Maybe better would be

  if ((lock.l_type == F_RDLCK) &&

2.

asingle.c(242): warning #175: subscript out of range
asingle.c(243): warning #175: subscript out of range

The source code is

#define FINDERIOFF_SCRIPT 24
#define FINDERIOFF_XFLAGS 25

    u_char              entry_buf[ 16 ];

	fh->finder_xinfo.fdScript = *(entry_buf + FINDERIOFF_SCRIPT);
	fh->finder_xinfo.fdXFlags = *(entry_buf + FINDERIOFF_XFLAGS);

Maybe entry_buf should be bigger.

3.

asingle.c(319): warning #175: subscript out of range
asingle.c(321): warning #175: subscript out of range

The source code is

#define ADEID_RFORK            2
#define NUMFORKS        2

    /* forklen[ NUM_FORKS] */

    if ( single.entry[ ADEID_RFORK ].ade_off == 0 ) {
        fh->forklen[ ADEID_RFORK ] = 0;
    } else {
        fh->forklen[ ADEID_RFORK ] =
                htonl( single.entry[ ADEID_RFORK ].ade_len );
    }


4.

megatron.c(217): warning #165: too few arguments in function call

The source code is

int from_open( un, file, fh, flags )
    int                 un, flags;
    char                *file;
    struct FHeader      *fh;
{
	/* ... */
}

    if ( from_open( module, path, &fh ) < 0 ) {


I strongly recommend use of function prototypes, from ISO C.
K & R style function declarations have been deprecated for
about fifteen years now.




Version-Release number of selected component (if applicable):
netatalk-1_5_5-9 

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Charlie Bennett 2004-07-26 16:49:53 EDT
FC2 and later have netatalk updated to 1.6.4.

Have you tried building this rev against FC1?
Comment 2 David Binderman 2004-11-05 14:43:13 EST
I can confirm that the "subscript out of range" warning
messages still occur in Fedora Core 3 Test 3.

That's almost a year those warnings have been produced, 
without a fix available in Fedora.


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