[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xl: use xstrdup in cpurange_parse



commit 80703daf3e65779ea80073e4f091faef5e881e44
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Wed May 25 14:23:56 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed May 25 14:42:35 2016 +0100

    xl: use xstrdup in cpurange_parse
    
    This ensures buf is always valid when it is passed to strtok_r.
    
    CID: 1291936
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 03ab644..d8530f0 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -847,7 +847,7 @@ static int update_cpumap_range(const char *str, 
libxl_bitmap *cpumap)
  */
 static int cpurange_parse(const char *cpu, libxl_bitmap *cpumap)
 {
-    char *ptr, *saveptr = NULL, *buf = strdup(cpu);
+    char *ptr, *saveptr = NULL, *buf = xstrdup(cpu);
     int rc = 0;
 
     for (ptr = strtok_r(buf, ",", &saveptr); ptr;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.