linux/drivers/isdn
Ian Munsie 8b4017d8c1 i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
When compiling this driver, the compiler throws the following warnings:

drivers/isdn/hardware/eicon/message.c:8426: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8427: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8434: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8435: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8436: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8447: warning: array subscript is above array bounds

This arises from the particular semantics the driver is using to write to
the nlc array (static byte[256]).  The array has a length in byte 0
followed by a T30_INFO struct starting at byte 1.

The T30_INFO struct has a number of variable length strings after the
station_id entry, which cannot be explicitly defined in the struct and the
driver accesses them with an array index to station_id beyond the length
of station_id.

This patch merely changes the semantics that the driver uses to access the
entries after the station_id entry to use the original 256 byte nlc array
taking the offset and length of the station_id entry to calculate where to
write in the array, thereby silencing the warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-15 15:47:02 -07:00
..
act2000 Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
capi CAPI: Remove experimental tag from middleware feature 2010-02-16 16:01:36 -08:00
divert headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
gigaset isdn: remove ishexdigit() in regard to isxdigit() 2010-02-26 01:24:24 -08:00
hardware i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver 2010-03-15 15:47:02 -07:00
hisax Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2010-02-28 19:23:06 -08:00
hysdn isdn: misplaced parenthesis in pof_handle_data() 2010-03-15 15:47:01 -07:00
i4l isdn: fix a few Kconfig imperfections 2010-02-22 15:45:53 -08:00
icn Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
isdnloop drivers/isdn: correct use of ! and & 2008-03-04 16:35:16 -08:00
mISDN mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion 2009-12-18 20:30:11 -08:00
pcbit Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
sc Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
Kconfig isdn: fix a few Kconfig imperfections 2010-02-22 15:45:53 -08:00
Makefile mISDN fix main ISDN Makefile 2008-08-02 16:28:20 +02:00