qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Peter A. G. Crosthwaite" <peter.crosthwaite@petalogix.com>
Cc: peter.maydell@linaro.org, monstr@monstr.eu,
	qemu-devel@nongnu.org, paul@codesourcery.com, duyl@xilinx.com,
	linnj@xilinx.com, edgar.iglesias@gmail.com, afaerber@suse.de,
	john.williams@petalogix.com
Subject: Re: [Qemu-devel] [PATCH v9 4/4] xilinx_zynq: machine model initial version
Date: Thu, 08 Mar 2012 10:42:59 -0600	[thread overview]
Message-ID: <4F58E193.2040806@codemonkey.ws> (raw)
In-Reply-To: <b6d750d19fa2d2bcf4ac3a608ad37431e3cee987.1330921815.git.peter.crosthwaite@petalogix.com>

On 03/04/2012 10:39 PM, Peter A. G. Crosthwaite wrote:
> Xilinx zynq-7000 machine model. Also includes device model for the zynq-specific
> system level control register (SLCR) module.
>
> Signed-off-by: Peter A. G. Crosthwaite<peter.crosthwaite@petalogix.com>
> Acked-by: Edgar E. Iglesias<edgar.iglesias@gmail.com>

This breaks the build for me:

cc1: warnings being treated as errors
/home/anthony/git/qemu/hw/zynq_slcr.c: In function ‘zynq_slcr_read’:
/home/anthony/git/qemu/hw/zynq_slcr.c:314:25: error: array subscript is above 
array bounds
/home/anthony/git/qemu/hw/zynq_slcr.c: In function ‘zynq_slcr_write’:
/home/anthony/git/qemu/hw/zynq_slcr.c:457:22: error: array subscript is above 
array bounds
make[1]: *** [zynq_slcr.o] Error 1


> +        case 0xA60 ... 0xA8C:
> +            s->afi[0][(offset - 0x700) / 4] = val;
> +            break;

And GCC is definitely right here.  This will pretty clearly overflow the array 
if offset is any of the allowable values per the switch statement.

Regards,

Anthony Liguori

  reply	other threads:[~2012-03-08 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05  4:39 [Qemu-devel] [PATCH v9 0/4] Zynq-7000 EPP platform model Peter A. G. Crosthwaite
2012-03-05  4:39 ` [Qemu-devel] [PATCH v9 1/4] cadence_uart: initial version of device model Peter A. G. Crosthwaite
2012-03-05  4:39 ` [Qemu-devel] [PATCH v9 2/4] cadence_ttc: " Peter A. G. Crosthwaite
2012-03-05  4:39 ` [Qemu-devel] [PATCH v9 3/4] cadence_gem: " Peter A. G. Crosthwaite
2012-03-05  4:39 ` [Qemu-devel] [PATCH v9 4/4] xilinx_zynq: machine model initial version Peter A. G. Crosthwaite
2012-03-08 16:42   ` Anthony Liguori [this message]
2012-03-10 10:15     ` Peter Crosthwaite
2012-03-10 10:22       ` Peter Crosthwaite
2012-03-07  1:25 ` [Qemu-devel] [PATCH v9 0/4] Zynq-7000 EPP platform model Edgar E. Iglesias
2012-03-07  1:33   ` John Linn

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=4F58E193.2040806@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=duyl@xilinx.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=john.williams@petalogix.com \
    --cc=linnj@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=paul@codesourcery.com \
    --cc=peter.crosthwaite@petalogix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).