netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: akpm@linux-foundation.org
Cc: isdn@linux-pingi.de, netdev@vger.kernel.org, imunsie@au.ibm.com,
	mac@melware.de, sgayda2@uiuc.edu
Subject: Re: [patch 2/3] i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
Date: Mon, 15 Mar 2010 15:48:42 -0700 (PDT)	[thread overview]
Message-ID: <20100315.154842.00466136.davem@davemloft.net> (raw)
In-Reply-To: <201003112207.o2BM7OZg013459@imap1.linux-foundation.org>

From: akpm@linux-foundation.org
Date: Thu, 11 Mar 2010 14:07:24 -0800

> From: Ian Munsie <imunsie@au.ibm.com>
> 
> 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>

Applied.

      reply	other threads:[~2010-03-15 22:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 22:07 [patch 2/3] i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver akpm
2010-03-15 22:48 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100315.154842.00466136.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=imunsie@au.ibm.com \
    --cc=isdn@linux-pingi.de \
    --cc=mac@melware.de \
    --cc=netdev@vger.kernel.org \
    --cc=sgayda2@uiuc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).