From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] python/xc: fix out of bounds array access Date: Tue, 15 Jun 2010 13:22:04 +0100 Message-ID: <4C178C8C02000078000067EA@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3F12697C.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3F12697C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Writing a NUL terminator here isn't even necessary, since snprintf() already guarantees proper termination. Signed-off-by: Jan Beulich --- 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] =3D 0; err_buf.code =3D XC_INTERNAL_ERROR; err =3D &err_buf; } --=__Part3F12697C.0__= Content-Type: text/plain; name="pyxc-array-bounds.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pyxc-array-bounds.patch" Writing a NUL terminator here isn't even necessary, since snprintf()=0Aalre= ady guarantees proper termination.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- 2010-06-15.orig/tools/python/xen/lowlevel/xc= /xc.c 2010-06-01 13:39:57.000000000 +0200=0A+++ 2010-06-15/tools/python/x= en/lowlevel/xc/xc.c 2010-06-15 10:55:11.000000000 +0200=0A@@ -58,7 = +58,6 @@ static PyObject *pyxc_error_to_exception=0A snprintf(err_b= uf.message, sizeof(err_buf.message),=0A "xc_interface_open= failed: %s",=0A strerror(errno));=0A- err_buf.mess= age[sizeof(err_buf)-1] =3D 0;=0A err_buf.code =3D XC_INTERNAL_ERROR= ;=0A err =3D &err_buf;=0A }=0A --=__Part3F12697C.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part3F12697C.0__=--