qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org, Andrzej Zaborowski <balrogg@gmail.com>
Subject: Re: [Qemu-devel] index out of bounds in qemu-0.10.2
Date: Sat, 18 Apr 2009 21:25:56 +0300	[thread overview]
Message-ID: <f43fc5580904181125y7d7f33b6jc3383e7c91223c39@mail.gmail.com> (raw)
In-Reply-To: <829169.28940.qm@web35202.mail.mud.yahoo.com>

On 4/17/09, Sergei Steshenko <sergstesh@yahoo.com> wrote:
> Hello,
>
>  I am compiling qemu-0.10.2 using the attached autogenerated 'configure'
>  wrapper (if anybody is interested in 'configure' command line options I'm
>  using_.
>
>  I am using self-built gcc-4.3.3, my OS is SUSE 10.3, 32 bits.
>
>  While running 'make' I've noticed this:
>
>      41 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_load’:
>      42 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      43 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      44 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:114: warning: array subscript is above array bounds
>      45 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/twl92230.c: In function ‘menelaus_save’:
>      46 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>      47 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>      48 /mnt/sdb8/sergei/AFSWD_debug/build/qemu-0.10.2/hw/hw.h:94: warning: array subscript is above array bounds
>  .
>
>  Once I had the same warnings compiling my own code, and 'gcc' was correct,
>  so most likely it's correct in this case too.
>
>  If so, please fix this.

My gcc and even sparse is completely silent, strange.

It's because of this area:

    uint8_t dcdc[3];

is saved like this:

    qemu_put_8s(f, &s->dcdc[3]);
    qemu_put_8s(f, &s->dcdc[3]);
    qemu_put_8s(f, &s->dcdc[3]);

and loaded like this:

    qemu_get_8s(f, &s->dcdc[3]);
    qemu_get_8s(f, &s->dcdc[3]);
    qemu_get_8s(f, &s->dcdc[3]);

which is of course wrong.

  reply	other threads:[~2009-04-18 18:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 22:49 [Qemu-devel] index out of bounds in qemu-0.10.2 Sergei Steshenko
2009-04-18 18:25 ` Blue Swirl [this message]
2009-04-19  0:23   ` andrzej zaborowski
  -- strict thread matches above, loose matches on Subject: below --
2009-04-18 19:37 Sergei Steshenko

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=f43fc5580904181125y7d7f33b6jc3383e7c91223c39@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=balrogg@gmail.com \
    --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).