Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp981505rwd; Thu, 15 Jun 2023 05:00:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AqYl/A77pqfKfZmKu+byKY3fTPTATcf45a4jQo8Sq2EQX2q5MbXoQcYLkAoZxUWzeoVh/ X-Received: by 2002:a05:6402:1842:b0:514:9904:c8fe with SMTP id v2-20020a056402184200b005149904c8femr9216171edy.39.1686830455027; Thu, 15 Jun 2023 05:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686830455; cv=none; d=google.com; s=arc-20160816; b=BcU3TWMGMTLC+H2hxVVDR1BMzRxbEyeCZdt6Aq9FhsNfS8dI3KKaVOJzxDxAfgSxq7 F+qZxfNKth63mMjG6AlUOW06bSXiXUiHNdN7iCwZfUMqZv2oZosOIR3S0lgCxWcIuC+e FdElBLwLdP6HGVmpZFIL9I0t/kpsCjCA4sO2avUG8YZyE9ndGvDrPA4LE0jyo+68qCF8 TUVrF37MVx0O3gv0Fx4lTj6zaR5Uvj+rcfs73zFGOU1bmpR8G0BV87jOLLur0pD7RTGC RClU/Ps8pRwXzsWik+LeU+3a/5HA/9eOjykJjkKz4+qYcytw8Y3MaMTN8Dph8HePx60n kaNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1wq1mvPwv87qau5vMX+qdyid4u4aDSz3AHzHdQMbszQ=; b=qudKIHAptHd/7/kBD3Z8w7A5u8BVUNbFzLUjS/WlSZFauI/+2uvFuY5shCiGXMlSjw +ernQJuF8UqIVPcJ6FOgwgJqlJ0AlMdN/+sepGlgTJ4ZF8ExSYo0NSNWbydfjVkZQ7zt WRFfb9tNRSShE8gmYEtjnDwgFxOSlwRwwpIQUoY+oMb31y9KZPjLtSZ0A6S6HmDhMxAL XmS+JVVfYKwJE/VKc1f/YhdJyPxEeX7RT3zRdVYiWvbWLyScvqcNE2AY3azLD2vjI8MG lQVynds3HGaprewo0eSwCW+OT77wCuV/L9vMG/ZbjqoB0RJnj0wM3+JgnML644P7Z8J9 oNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F6wvQgZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a50e60a000000b00514b8791a4esi190330edm.590.2023.06.15.05.00.28; Thu, 15 Jun 2023 05:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F6wvQgZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245466AbjFOLYK (ORCPT + 99 others); Thu, 15 Jun 2023 07:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236141AbjFOLYI (ORCPT ); Thu, 15 Jun 2023 07:24:08 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A1C51FDB for ; Thu, 15 Jun 2023 04:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686828248; x=1718364248; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=wZealJFBuKHllUbXwzgu9RKiUrb3oBvFvTlLh890Dvg=; b=F6wvQgZX7P3aH3k6QKOKh0heCmVXLvkGn9G4lfsb8v8wqk7eZVQ2OUGZ gwTCaiafS8FjEbx14qD68/NPnTSEQu1ScyZhHaP1oyTRdg4B8QH0lkh8O 5F3p8nj1HO0mipYeqfKGmI50WorjVkuO/+voz5D0kRL+qMAu6tJBtWmXa ArXQYfb1Fl+Zs9UVBh2gbmZll+mv679/PK84roqThta1gUv1n+mTFD7gu EFJIW2QUhdt2fh9ttBg+Noy5nPvc3wlm/72pXLD3W1jNbPoaIwbNf9QJs 3b1BtTrRUM3aGUzzg0AT9rPWszehHBE4hH8fw6KV5XRCXQGi142YBfETS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="361363997" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="361363997" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2023 04:24:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="886607456" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="886607456" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 15 Jun 2023 04:24:02 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q9l55-003vZr-1M; Thu, 15 Jun 2023 14:23:59 +0300 Date: Thu, 15 Jun 2023 14:23:59 +0300 From: Andy Shevchenko To: David Laight Cc: 'Demi Marie Obenour' , Alexey Dobriyan , "linux-kernel@vger.kernel.org" , Rasmus Villemoes , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Lee Jones , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Petr Mladek , Steven Rostedt , Sergey Senozhatsky Subject: Re: [PATCH v3 0/4] Make sscanf() stricter Message-ID: References: <6ab6adce-2318-4ae6-bde6-4317485639fd@p183> <23df90dd35874fd89c64906e6a6de164@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 15, 2023 at 08:06:46AM +0000, David Laight wrote: > From: Demi Marie Obenour > > Sent: 14 June 2023 21:09 ... > > > What sort of formats and data are being used? > > > > Base-10 or base-16 integers, with whitespace never being valid. > > In which case sscanf() really isn't what you are looking for. > > > > The "%s" format terminates on whitespace. > > > Even stroul() (and friends) will skip leading whitespace. > > > > Yes, which is a reason that strto*l() are just broken IMO. > > They are not 'broken', that is what is useful most of the time. > The usual problem is that "020" is treated as octal. > > > I’m trying to replace their uses in Xen with custom parsing code. > > Then write a custom parser :-) Hmm... Usually we are against zillion implementations of the same with zillion bugs hidden (each buggy implementation with its own bugs). -- With Best Regards, Andy Shevchenko