Bug 146444

Summary: rocksndiamonds-3.1.1-2: array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Michal Marek <mmarek>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2006-01-28 11:14:53 UTC
I just tried to compile package rocksndiamonds-3.1.1-2 with the Intel C compiler.

It said

init.c(4418): warning #175: subscript out of range

The source code is

	music_id_prefix[MAX_LEVELS] = NULL;

but

  static char *music_id_prefix[NUM_MUSIC_PREFIXES + 1];

and

#define MAX_LEVELS                     1000
#define NUM_MUSIC_PREFIXES             1

I agree with the compiler.  Suggest new code

	music_id_prefix[NUM_MUSIC_PREFIXES] = NULL;
Comment 1 Michal Marek 2006-01-31 17:52:57 UTC
Hi,

thanks for finding the bug. I've submitted the fix into our distribution and also
contacted the author (Holger Schemel <info@artsoft.org>).