xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] python/xc: fix out of bounds array access
@ 2010-06-15 12:22 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-06-15 12:22 UTC (permalink / raw)
  To: xen-devel

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-15 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-15 12:22 [PATCH] python/xc: fix out of bounds array access Jan Beulich

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).