WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: off by one fix for new network-attach args pa

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: off by one fix for new network-attach args parsing
From: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Date: Sun, 12 Jun 2011 20:54:11 +0200
Cc: marmarek@xxxxxxxxxxxx
Delivery-date: Sun, 12 Jun 2011 11:55:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.8.2
# HG changeset patch
# User Marek Marczykowski <marmarek@xxxxxxxxxxxx>
# 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@xxxxxxxxxxxx>

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)
 {



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