From: Keir Fraser Date: Tue, 23 Oct 2007 13:42:06 +0000 (+0100) Subject: libxc: check length on string copy (strcpy -> strncpy). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14845^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=093d6da712d5ad5a3f8158bb967cc119c2408aa1;p=xen.git libxc: check length on string copy (strcpy -> strncpy). Signed-off-by: Christoph Egger --- diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c index e26941f737..30906ee993 100644 --- a/tools/libxc/xc_dom_boot.c +++ b/tools/libxc/xc_dom_boot.c @@ -92,7 +92,9 @@ int xc_dom_compat_check(struct xc_dom_image *dom) 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) ) {