Bug 151539 - netatalk-2.0.3-6: 2 * array subscript out of range
Summary: netatalk-2.0.3-6: 2 * array subscript out of range
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SuSE Linux 10.1
: P5 - None : Normal
Target Milestone: ---
Assignee: Olaf Hering
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 16:48 UTC by David Binderman
Modified: 2006-02-22 14:49 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2006-02-16 16:48:54 UTC
I just tried to compile package netatalk-2.0.3-6 with a non standard version
of the GNU C compiler.

It said

1.

asingle.c:313: warning: array subscript out of range

The source code is

	fh->forklen[ ADEID_RFORK ] = 0;

but

linux:/usr/src/packages/SPECS # find ../BUILD/netatalk-2.0.3/ -name \*.h -print | xargs fgrep ADEID_RFORK
../BUILD/netatalk-2.0.3/include/atalk/adouble.h:#define ADEID_RFORK             2

linux:/usr/src/packages/SPECS # find ../BUILD/netatalk-2.0.3/ -name \*.h -print | xargs fgrep "forklen["
../BUILD/netatalk-2.0.3/bin/megatron/megatron.h:    u_int32_t           forklen[ NUMFORKS ];

linux:/usr/src/packages/SPECS # find ../BUILD/netatalk-2.0.3/ -name \*.h -print | xargs fgrep "NUMFORKS"
../BUILD/netatalk-2.0.3/bin/megatron/megatron.h:#define NUMFORKS        2

So it seems clear that the program is trying to access element 2 in a two element
array. Suggest code rework.

2.

asingle.c:315: warning: array subscript out of range

Duplicate.
Comment 1 Olaf Hering 2006-02-20 15:23:29 UTC
I tend to think it should be [ADEID_RFORK-1], same for ADEID_DFORK usage. But maybe the final fix will look different.
Asked maintainers for advice.
Comment 2 Olaf Hering 2006-02-22 14:49:23 UTC
I changed the index to RESOURCE.