xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Marek Marczykowski <marmarek@mimuw.edu.pl>
To: xen-devel@lists.xensource.com
Cc: marmarek@mimuw.edu.pl
Subject: [PATCH] libxl: off by one fix for new network-attach args parsing
Date: Sun, 12 Jun 2011 20:54:11 +0200	[thread overview]
Message-ID: <764214d25cd9825925ae.1307904851@devel14> (raw)

# HG changeset patch
# User Marek Marczykowski <marmarek@mimuw.edu.pl>
# Date 1307904815 -7200
# Node ID 764214d25cd9825925aeb846a6bdec56c9a5259a
# Parent  262a414e7e37541ff3c1346b316487606e9e736f
libxl: off by one fix for new network-attach args parsing

sizeof(const string) returns string length WITH \0 terminator.

Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1238,7 +1238,7 @@ static int match_option_size(const char 
     return !rc;
 }
 #define match_option(_prefix, _arg, _oparg) \
-    match_option_size((_prefix "="), sizeof((_prefix)) + 1, (_arg), &(_oparg))
+    match_option_size((_prefix "="), sizeof((_prefix)), (_arg), &(_oparg))
 
 static void replace_string(char **str, const char *val)
 {

             reply	other threads:[~2011-06-12 18:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-12 18:54 Marek Marczykowski [this message]
2011-06-17 17:58 ` [PATCH] libxl: off by one fix for new network-attach args parsing Ian Jackson
2011-06-21 16:49   ` [PATCH RESENT] xl: Use macros for param parsing in network-attach, to prevent use explicit sizeof("param") Marek Marczykowski
2011-06-27 14:26     ` Ian Jackson
2011-06-27 14:37       ` Marek Marczykowski
2011-06-27 16:21         ` Ian Jackson

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=764214d25cd9825925ae.1307904851@devel14 \
    --to=marmarek@mimuw.edu.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).