Bug 152088 - sarien-0.7.0-885: array subscript out of range
Summary: sarien-0.7.0-885: array subscript out of range
Status: RESOLVED DUPLICATE of bug 235591
Alias: None
Product: openSUSE 10.2
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SuSE Linux 10.1
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-19 13:56 UTC by David Binderman
Modified: 2007-01-16 22:17 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-19 13:56:52 UTC
I just tried to compile package sarien-0.7.0-885 with the Intel C compiler.

It said

op_cmd.c(650): warning #175: subscript out of range

The source code is

        _v[p1] = atoi (game.strings[MAX_WORDS2]);

but

linux:/usr/src/packages/SPECS # find ../BUILD/sarien-0.7.0/ -name \*.h -print | xargs fgrep "strings["
../BUILD/sarien-0.7.0/src/include/agi.h:        char strings[MAX_WORDS1][MAX_WORDS2];   /**< strings */

and

linux:/usr/src/packages/SPECS # find ../BUILD/sarien-0.7.0/ -name \*.h -print | xargs grep "define.*MAX_WORDS"
../BUILD/sarien-0.7.0/src/include/sarien.h:#define MAX_WORDS    20
../BUILD/sarien-0.7.0/src/include/sarien.h:#define MAX_WORDS1   24
../BUILD/sarien-0.7.0/src/include/sarien.h:#define      MAX_WORDS2      41      /* Last string is used by get.num */

so it seems that the program is trying to index 41 into an array of size 24.

Suggest code rework.
Comment 1 Hendrik Vogelsang 2006-02-20 11:23:51 UTC
same here -> http://sarien.sourceforge.net/ latest CVS change is from 6day ago. 
Comment 2 David Binderman 2006-05-24 22:04:50 UTC
I am able to confirm that this bug still exists in Suse Linux 10.1

Comment 3 Hendrik Vogelsang 2006-07-27 09:27:10 UTC
So please report it upstream!
Comment 4 David Binderman 2006-07-27 12:18:46 UTC
(In reply to comment #3)
> So please report it upstream!

Thanks for your kind offer, but I don't think I'll bother.

It looks to me like I will need Yet Another Account On
Yet Another Project to report this, and for one bug report,
for me it is not worth the bother.

Feel free to report it yourself if you like. You may even
already have an account with the Sarien project.


Comment 5 David Binderman 2006-11-07 17:39:41 UTC
Still broken on Suse Linux 10.2 Beta 1.

Comment 6 Stefan Dirsch 2007-01-16 16:57:13 UTC
Can this warning be reproduced with gcc?
Comment 7 Stefan Dirsch 2007-01-16 21:28:01 UTC
d binderman <dcb314@hotmail.com> wrote:
"What I wanted to say was that gcc finds no problem,
 but if gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268
 ever gets fixed, then it will."
Comment 8 Stefan Dirsch 2007-01-16 21:30:07 UTC
Ok. Let me know, when the gcc bug is fixed. I then can open a bugreport to make these warnings even fatal for a package build and close this one as duplicate.
Comment 9 Stefan Dirsch 2007-01-16 22:17:00 UTC

*** This bug has been marked as a duplicate of bug 235591 ***