Bug 152209 - tkrat-2.1.5-6: 2 * array subscript out of range
Summary: tkrat-2.1.5-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: Reinhard Max
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-20 11:02 UTC by David Binderman
Modified: 2006-02-20 23:05 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-20 11:02:56 UTC
I just tried to compile package tkrat-2.1.5-6 with a non standard
version of the GNU C compiler.

It said

1.

ratCode.c:874: warning: array subscript out of range

The source code is

	buf[0] = buf[3];

but

	unsigned char buf[3];

Suggest make array buf one bigger.

2.

ratDbFolder.c:403: warning: array subscript out of range

The source code is

            case 'T':   flagArray[RAT_DRAFT] = 1; break;

but

    int flagArray[4] = {0,0,0,0};

and

typedef enum {
    RAT_SEEN,                   /* Message content has been seen by the user */
    RAT_DELETED,                /* Message is marked for deletion */
    RAT_FLAGGED,                /* Message is flagged */
    RAT_ANSWERED,               /* Message has been answered */
    RAT_DRAFT,                  /* Message is a draft */
    RAT_RECENT                  /* Message is a not seen but has been in the
                                   folder for some time */
} RatFlag;

so the program is trying to access flagArray[ 4]. Suggest code rework.
Comment 1 Reinhard Max 2006-02-20 23:05:06 UTC
Fixed for 10.1.