From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCHv2 3/4] libxl: add version_info function Date: Wed, 21 Apr 2010 21:35:03 +0200 Message-ID: <4BCF5367.6090509@amd.com> References: <1271859446-25892-1-git-send-email-andre.przywara@amd.com> <1271859446-25892-4-git-send-email-andre.przywara@amd.com> <4BCF1366.1050201@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BCF1366.1050201@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Vincent Hanquez Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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