Bugzilla – Bug 151539
netatalk-2.0.3-6: 2 * array subscript out of range
Last modified: 2006-02-22 14:49:23 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.
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.
I changed the index to RESOURCE.