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] Re: [PATCHv2 3/4] libxl: add version_info function

To: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCHv2 3/4] libxl: add version_info function
From: Andre Przywara <andre.przywara@xxxxxxx>
Date: Wed, 21 Apr 2010 21:35:03 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 21 Apr 2010 12:36:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BCF1366.1050201@xxxxxxxxxxxxx>
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>
References: <1271859446-25892-1-git-send-email-andre.przywara@xxxxxxx> <1271859446-25892-4-git-send-email-andre.przywara@xxxxxxx> <4BCF1366.1050201@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081105)
Vincent Hanquez wrote:
On 21/04/10 15:17, Andre Przywara wrote:
+
+    xc_version(ctx->xch, XENVER_commandline,&u.xen_commandline);
+    info->commandline = libxl_sprintf(ctx, u.xen_commandline);

oh actually just missed that; it's important to not include a variable as the format string: if for some reason any of this field end up containing a %something, it will lead usually to segfault.
Of course! I could tell you that I just wanted to know if someone will find this, but actually I was so keen on just replacing strdup with libxl_sprintf that I totally overlooked the changed semantic of the call.
>
> can you please replace all:
>
> libxl_sprintf(ctx, ..);
>
> by:
>
> libxl_sprintf(ctx, "%s", ...);
>

Sure! Corrected patch follows!

Thanks for looking carefully!

Andre.

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


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