qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [parch] Incorrect IO index overflow check
Date: Sat, 29 Oct 2005 21:29:28 +0100	[thread overview]
Message-ID: <200510292129.28691.paul@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 87 bytes --]

The attached patch fixes an incorrect overflow check in 
cpu_register_io_memory.

Paul

[-- Attachment #2: patch.qemu_io_overflow --]
[-- Type: text/x-diff, Size: 742 bytes --]

Index: exec.c
===================================================================
RCS file: /cvsroot/qemu/qemu/exec.c,v
retrieving revision 1.65
diff -u -p -r1.65 exec.c
--- exec.c	3 Sep 2005 10:49:04 -0000	1.65
+++ exec.c	29 Oct 2005 20:25:10 -0000
@@ -2095,14 +2095,11 @@ int cpu_register_io_memory(int io_index,
     int i;
 
     if (io_index <= 0) {
-        if (io_index >= IO_MEM_NB_ENTRIES)
-            return -1;
         io_index = io_mem_nb++;
-    } else {
-        if (io_index >= IO_MEM_NB_ENTRIES)
-            return -1;
     }
-    
+    if (io_index >= IO_MEM_NB_ENTRIES)
+        return -1;
+
     for(i = 0;i < 3; i++) {
         io_mem_read[io_index][i] = mem_read[i];
         io_mem_write[io_index][i] = mem_write[i];

                 reply	other threads:[~2005-10-29 20:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200510292129.28691.paul@codesourcery.com \
    --to=paul@codesourcery.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).