[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/xenconsoled: fix detection of sscanf() failure in xs_gather()


  • To: balaandeguefrancoislionnel@xxxxxxxxx
  • From: Stephen Cheng <stephen.cheng@xxxxxxxxxx>
  • Date: Thu, 3 Dec 2026 12:36:13 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z3lRp0WYa1R6k3fPhmQsSUbWEazIEPaTgHspTDMDxsI=; b=n9CmRNwHoUuOh7tARHAkojNM45dZ3tSQTeKxzTfYgow9fCko58grAlJENx/IHzy8Ha+fhAlx0k9Pvs1OYz2LCkOidbt3sXgC5EUOSanbByo1QcSCxny3B6CWKsR8VIjMUjUPU+3MKBncrXgoSrDCQMn6NMCR7ren33xDbsp+lsMwssh4ILxOHamCUTXmxhLKYIv359ryWXbRTs3wJxzNU1dMKaiJAyHaO3XMjRcaVecdlo6SaMnLViO5I1AIelpDFZ8E5KRHOWhbkE79bOWHhdIz0fsIKNuDIFcedKv8r2q6xZlN/hz2Idi0Z9xj9TiEwlaQw3ynurQXMIO5DOxJkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XWbwiRWI6OH/xjPTPfwU2tAcxjXMyXKEDTZTIc4JxmPg4JhpdhoUOvinGRmgNvD0/r0mps74aumcesuj4KAQAkOaB+bVCnrM9l+g3Yl25vODwABVDktMeoQj89h+qDI2evQOQWDFJBIkgme0LIeIEYhZZ350tuncL42OovuzKn/IheQ95C/4DsQ8LZ0HWWG2cR7rsUYXP1bq8Reqp2i5Uo3WmSkSj+gR/Qi7iYizi0xmNqFrSy8DhBoKsQ/45GaS7yiiod1ax+G8YEEtPwqWRJ5M6T28Brc8dI87eJnKjsKRGjk/IeyoQN7zXj5ydCc6k9Fz7CcEM2s3a7JMC3K4oQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: anthony.perard@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stephen Cheng <stephen.cheng@xxxxxxxxxx>
  • Delivery-date: Thu, 03 Dec 2026 04:36:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/11/2026 23:20, Bala Andegue François Lionnel wrote:
> [...]
>               if (fmt) {
> -                     if (sscanf(p, fmt, result) == 0)
> +                     if (sscanf(p, fmt, result) != 1)
>                               ret = EINVAL;
>                       free(p);
>               } else

An empty value should not happen in normal use, since libxl always
writes a number to these nodes and the guest can only read them. But
the fix is still correct: xs_gather() passes one result pointer to
each sscanf() call, so a format can only have one conversion and 1 is
the only success value.

Reviewed-by: Stephen Cheng <stephen.cheng@xxxxxxxxxx>

Stephen



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.