xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] python/xc: fix out of bounds array access
Date: Tue, 15 Jun 2010 13:22:04 +0100	[thread overview]
Message-ID: <4C178C8C02000078000067EA@vpn.id2.novell.com> (raw)

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

Writing a NUL terminator here isn't even necessary, since snprintf()
already guarantees proper termination.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/tools/python/xen/lowlevel/xc/xc.c	2010-06-01 13:39:57.000000000 +0200
+++ 2010-06-15/tools/python/xen/lowlevel/xc/xc.c	2010-06-15 10:55:11.000000000 +0200
@@ -58,7 +58,6 @@ static PyObject *pyxc_error_to_exception
         snprintf(err_buf.message, sizeof(err_buf.message),
                  "xc_interface_open failed: %s",
                  strerror(errno));
-        err_buf.message[sizeof(err_buf)-1] = 0;
         err_buf.code = XC_INTERNAL_ERROR;
         err = &err_buf;
     }




[-- Attachment #2: pyxc-array-bounds.patch --]
[-- Type: text/plain, Size: 678 bytes --]

Writing a NUL terminator here isn't even necessary, since snprintf()
already guarantees proper termination.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/tools/python/xen/lowlevel/xc/xc.c	2010-06-01 13:39:57.000000000 +0200
+++ 2010-06-15/tools/python/xen/lowlevel/xc/xc.c	2010-06-15 10:55:11.000000000 +0200
@@ -58,7 +58,6 @@ static PyObject *pyxc_error_to_exception
         snprintf(err_buf.message, sizeof(err_buf.message),
                  "xc_interface_open failed: %s",
                  strerror(errno));
-        err_buf.message[sizeof(err_buf)-1] = 0;
         err_buf.code = XC_INTERNAL_ERROR;
         err = &err_buf;
     }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2010-06-15 12:22 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=4C178C8C02000078000067EA@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /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).