[Bug 237943] New: libcap-1.10-4: array subscript is above array bounds
https://bugzilla.novell.com/show_bug.cgi?id=237943 Summary: libcap-1.10-4: array subscript is above array bounds Product: openSUSE 10.3 Version: unspecified Platform: All OS/Version: SuSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de I just tried to compile package libcap-1.10-4 with the new GNU compiler version 4.3 snapshot 20070119 The compiler said cap_extint.c:116: warning: array subscript is above array bounds The source code is for (set=0; set<=NUMBER_OF_CAP_SETS; ++set) { int blk; int bno = 0; for (blk=0; blk<(CAP_SET_SIZE/4); ++blk) { __u32 val = 0; if (bno != blen) val = export->bytes[bno++][set]; So we can see that the outer for loop has local variable "set" at value NUMBER_OF_CAP_SETS the last time through the loop. But, earlier in the same file __u8 bytes[CAP_SET_SIZE][NUMBER_OF_CAP_SETS]; So the second dimension of the bytes array is exclusive in NUMBER_OF_CAP_SETS. I agree with the compiler. Suggest code rework. Maybe for (set=0; set < NUMBER_OF_CAP_SETS; ++set) { would be enough. -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=237943 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |tiwai@novell.com |screening@forge.provo.novell| |.com | -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=237943 tiwai@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from tiwai@novell.com 2007-01-24 04:09 MST ------- Thanks, the fixed package is submitted to STABLE/FACTORY. -- 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.
participants (1)
-
bugzilla_noreply@novell.com