[Bug 246654] New: sane-backends-1.0.18-5: array subscript is above array bounds
https://bugzilla.novell.com/show_bug.cgi?id=246654 Summary: sane-backends-1.0.18-5: 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@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de I just tried to compile package sane-backends-1.0.18-5 with the GNU C compiler version 4.3 snapshot 20070216. The compiler said niash.c:1099: warning: array subscript is above array bounds The source code is _SetScalarGamma (s->aGammaTable, s->aValues[n].w); but n has the value optGamma, which is 17 and TOptionValue aValues[optLast]; and optLast has the value 12. Suggest code rework. -- 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=246654 chrubis@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |jsmeix@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=246654 jsmeix@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- 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=246654 jsmeix@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #1 from jsmeix@novell.com 2007-02-21 08:35 MST ------- Submitted fixed package to STABLE, reported the problem upstream. This is my patch: -------------------------------------------------------------------------- --- backend/niash.c.orig 2006-02-04 12:34:28.000000000 +0100 +++ backend/niash.c 2007-02-21 15:38:12.000000000 +0100 @@ -89,7 +89,9 @@ typedef enum optLamp, optCalibrate, - optGamma /* analog gamma = single number */ + optGamma, /* analog gamma = single number */ +/* have optEndOfList only to define arrays with sufficient size */ + optEndOfList } EOptionIndex; @@ -105,8 +107,8 @@ typedef union typedef struct { - SANE_Option_Descriptor aOptions[optLast]; - TOptionValue aValues[optLast]; + SANE_Option_Descriptor aOptions[optEndOfList]; + TOptionValue aValues[optEndOfList]; TScanParams ScanParams; THWParams HWParams; -------------------------------------------------------------------------- -- 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