All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: eric.chanudet@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>
Subject: [PATCH] xl: fix strtok() call in vif2 parsing
Date: Fri, 20 Aug 2010 13:58:36 +0200	[thread overview]
Message-ID: <4C6E6DEC.5030601@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

Hi,

according to the manpage subsequent calls to strtok() must use
NULL in the string parameter to keep the iteration going.
Fix fixes a hang when parsing the vif2 parameter.

Regards,
Andre.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12

[-- Attachment #2: xl-fix-strtok-call-in-vif2-parsing.patch --]
[-- Type: text/x-patch, Size: 1043 bytes --]

>From 1abc666eb715b06c829491626e246fa8b9c8e6e9 Mon Sep 17 00:00:00 2001
From: Andre Przywara <andre.przywara@amd.com>
Date: Fri, 20 Aug 2010 09:55:43 +0200
Subject: [PATCH 2/4] xl: fix strtok() call in vif2 parsing

According to the manpage subsequent calls to strtok() must use
NULL in the string parameter to keep the iteration going.
Fix fixes a hang when parsing the vif2 parameter.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 323dd04..c291879 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -859,7 +859,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)) {
-- 
1.6.4


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2010-08-20 11:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6E6DEC.5030601@amd.com \
    --to=andre.przywara@amd.com \
    --cc=eric.chanudet@citrix.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.