# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193146926 -3600
# Node ID 8f33d2c6c67c1b9d647280c2ba8ce6f907583871
# Parent b3fa9b58a102c17313da66e4c6150b117f3b3661
libxc: check length on string copy (strcpy -> strncpy).
Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
tools/libxc/xc_dom_boot.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
diff -r b3fa9b58a102 -r 8f33d2c6c67c tools/libxc/xc_dom_boot.c
--- a/tools/libxc/xc_dom_boot.c Tue Oct 23 14:38:47 2007 +0100
+++ b/tools/libxc/xc_dom_boot.c Tue Oct 23 14:42:06 2007 +0100
@@ -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) )
{
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|