From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: [PATCH][TOOLS] libxc: check length on copy Date: Tue, 23 Oct 2007 14:36:23 +0200 Message-ID: <200710231436.23318.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_HreHHKrzYX7QcZz" 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 --Boundary-00=_HreHHKrzYX7QcZz Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch checks length on string copy. Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_HreHHKrzYX7QcZz Content-Type: text/plain; charset=us-ascii; name=xen_xc.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen_xc.diff diff -r 4970cbf9b19e tools/libxc/xc_dom_boot.c --- a/tools/libxc/xc_dom_boot.c Tue Oct 23 09:41:06 2007 +0100 +++ b/tools/libxc/xc_dom_boot.c Tue Oct 23 13:59:19 2007 +0200 @@ -92,7 +92,9 @@ int xc_dom_compat_check(struct xc_dom_im char *item, *ptr; int match, found = 0; - strcpy(xen_caps, dom->xen_caps); + strncpy(xen_caps, dom->xen_caps, XEN_CAPABILITIES_INFO_LEN - 1); + xen_caps[XEN_CAPABILITIES_INFO_LEN - 1] = '\0'; + for ( item = strtok_r(xen_caps, " ", &ptr); item != NULL ; item = strtok_r(NULL, " ", &ptr) ) { --Boundary-00=_HreHHKrzYX7QcZz 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 --Boundary-00=_HreHHKrzYX7QcZz--