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

[Xen-changelog] [xen-unstable] xl: fix strtok() call in vif2 parsing



# HG changeset patch
# User Andre Przywara <andre.przywara@xxxxxxx>
# Date 1282670300 -3600
# Node ID b1801cce513876cee5df4bf0c417820fe5c9b291
# Parent  a67b98978f5b41d69ded8901ec1bdfe9dd0b007c
xl: fix strtok() call in vif2 parsing

Fix fixes a hang when parsing the vif2 parameter.

According to the manpage subsequent calls to strtok() must use
NULL in the string parameter to keep the iteration going.

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r a67b98978f5b -r b1801cce5138 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Aug 24 16:15:56 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Aug 24 18:18:20 2010 +0100
@@ -883,7 +883,7 @@ skip:
 
             init_net2_info(net2, d_config->num_vif2s);
 
-            for (p = strtok(buf2, ","); p; p = strtok(buf2, ",")) {
+            for (p = strtok(buf2, ","); p; p = strtok(NULL, ",")) {
                 while (isblank(*p))
                     p++;
                 if (!strncmp("front_mac=", p, 10)) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.