Mailinglist Archive: opensuse-bugs (8114 mails)

< Previous Next >
[Bug 247334] New: zapping-0.9.6-65 : array subscript is above array bounds
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Wed, 21 Feb 2007 06:39:54 -0700 (MST)
  • Message-id: <bug-247334-21960@xxxxxxxxxxxxxxxxxxxxxxxxx/>
https://bugzilla.novell.com/show_bug.cgi?id=247334

Summary: zapping-0.9.6-65 : array subscript is above array bounds
Product: openSUSE 10.3
Version: Alpha 1
Platform: All
OS/Version: SuSE Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Other
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: dcb314@xxxxxxxxxxx
QAContact: qa@xxxxxxx


I just tried to compile package zapping-0.9.6-65
with the GNU C compiler version 4.3 snapshot 20070216.

The compiler said

tveng1.c:2279: warning: array subscript is above array bounds

The source code is

for (smaller = -1; smaller < (int) N_ELEMENTS (common_sizes);
++smaller) {
if (size <= (common_sizes[smaller + 1].width
* common_sizes[smaller + 1].height))
break;
}

I agree with the compiler. Better code might be

for (smaller = -1; smaller < (int) N_ELEMENTS (common_sizes) -
1;
++smaller) {
if (size <= (common_sizes[smaller + 1].width
* common_sizes[smaller + 1].height))
break;
}


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

< Previous Next >
Follow Ups