From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3539E145A1C for ; Thu, 18 Jul 2024 18:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=81.169.146.166 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721326158; cv=pass; b=k+4v72Wo6mlSYSjbU+HspTuarakmax9a13OlG8YbuUPf+3dGAwoQVluyC/baJuEjxbt/2PSDFiOuT++bcE3YhTnj5NjZK00ApZetI7S+c4TEk6x+kfblzms5BXZQWzggaUZDLVMwi8w04NmfOuB/rAu0KJ9VjFadA9VpL/lUilA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721326158; c=relaxed/simple; bh=5RpG6M7s49k3PegXVqu3rFj3Zzz+Dl1TjZM5gBl1ZK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WB+jCk/sgtRRnM99A9SzlAecb7RxIsxqttc+Wa+duwfXZJPElZPgYrjKHXdODhXMXrCCcnVVUdkxzU3vZam6V5tQz5aEGvOeFP5Hb4tSisY9NY/KHlcV5n/Et45teML5+ReqglQJow0MUe6StDIu6wyGVcwWMoBWIMgBbRTILqQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=clisp.org; spf=none smtp.mailfrom=clisp.org; dkim=pass (2048-bit key) header.d=clisp.org header.i=@clisp.org header.b=KcC5JAUn; dkim=permerror (0-bit key) header.d=clisp.org header.i=@clisp.org header.b=iW1nEDIQ; arc=pass smtp.client-ip=81.169.146.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=clisp.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=clisp.org header.i=@clisp.org header.b="KcC5JAUn"; dkim=permerror (0-bit key) header.d=clisp.org header.i=@clisp.org header.b="iW1nEDIQ" ARC-Seal: i=1; a=rsa-sha256; t=1721325969; cv=none; d=strato.com; s=strato-dkim-0002; b=Rgg7Yoykh95LBxA2PRCMzmrqrrds9JrzhGE+M1/B/lRngBQLtBO2f3VBvqMlRYh2WD cob8nzIB5my49L0o1KDtSOEXCmX5xYNHljzhI4Aapr6KeCFKc3e4dv4xd9GaCcPjUwtr E7SGiuU7hK7KqcXz4T6ymZKsVaFeUEQRbOFf0Ra30UMjWN/DzWLNT244+pCHskniHk11 9Ct7IRIOVVtNCD5c78QZNd/ngGoxwG5e+SZlYf0TJWoRGfOM2xxqbfqhaHu3BL29Exxf NV0ajuH3Lb9iI1o/KvXUIfuKgVK2cWSW9TqfY4HMepdKXHc1nKBq+oes3r2FRpCqxB2k 8YyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1721325969; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=5RpG6M7s49k3PegXVqu3rFj3Zzz+Dl1TjZM5gBl1ZK4=; b=Kcm+5qw2bmr6mmugzKeMmmPFkW/YHEkHli379perRjWtiQN60qItF5LG5DNjJsjOyf 1Ls2sLDlRWfR37liHXcXewqy7G4mKbsjjVXhpTkpUzXVsPq5J9azKkSl8snrHshW+j6o POBVM+iG3AxM17009i4fCbps8o9RGuGt4Y9tqGg43gg2G0yDLV2QJyMz9l3FMXkL1v35 aJ7rIUNpKLaKbi/ZabWNxHLB3DLmO/0YJnEgqc4EuwofHG70TveFQ4HncbpAl3ZkhFQp a0WddHdVPzcHi1mvZlASLKN93H/OKEQHl8JApKhMJBJd8aLWJqnNwkJpqo37Et6H/iXt cXPg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1721325969; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=5RpG6M7s49k3PegXVqu3rFj3Zzz+Dl1TjZM5gBl1ZK4=; b=KcC5JAUnxu2bQa/mF9AQReUcv53BNioTjBVZ2BDs1wU/ylLo5g7btyb6bo6R0nP6ic HUPX09ALFpGpvcT774XWpjRCg9lJdkN8cxj7D2XCcdBbRODuTtkCri5UnzOTqvUM+EiL cLC06+hRXc7oIWkgu88UtdkVloHzZKfF/2MN0tv9tYAE+OSSX2Q10MnckCtfkkdNAki3 KarcA2wikxEHFX4WryhumnYQQM9XUU6DYImtv6ozFiMm0Y/6QkkJnnXc+Y3VZlOXkjcj vIBVWoGrxGKwSVWmsxZ3mBPhhmlHIlaAOQnWan8bQ5tpW8tTvoxCX5LEvgn2F+enIvSN 1xJA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1721325969; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=5RpG6M7s49k3PegXVqu3rFj3Zzz+Dl1TjZM5gBl1ZK4=; b=iW1nEDIQZm992PXBflutByg4c/rZCR6XxaWJwa5p1RjwQFs75DzmHQZFY1JWo2REGM YE0/jqAVk2DdJjO/AqCQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPCjqFxtlDfTi9pddt8LZVl8os5yg==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.5.0 AUTH) with ESMTPSA id N0957e06II68DSy (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 18 Jul 2024 20:06:08 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Cc: Alejandro Colomar , Paul Eggert , =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Eli Schwartz , Sam James , Serge Hallyn , Iker Pedrosa , "Andrew J. Hesford" , Michael Vetter , liba2i@lists.linux.dev Subject: Re: [PATCH v1] xstrtol: 1 is not a valid base Date: Thu, 18 Jul 2024 20:06:07 +0200 Message-ID: <2143892.otsE0voPBg@nimes> In-Reply-To: <20240718165154.38938-1-alx@kernel.org> References: <20240718165154.38938-1-alx@kernel.org> Precedence: bulk X-Mailing-List: liba2i@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Alejandro Colomar wrote: > If xstrtol() was being called with a base of 1, under some conditions it > would invoke Undefined Behavior. Yes, sure. A numeric base of 1 makes no sense, mathematically. Thanks for the patch; applied. Note that I disagree with the statement from https://github.com/void-linux/void-packages/issues/51261#issuecomment-2237055195 : > Yet he introduced that bug a decade ago I wouldn't call it a bug. Gnulib does not document that passing a base of 1 to xstrtol is valid. It's known to everyone in the field that a base of 1 makes no sense. So, what you saw here was a slightly incomplete input validation check. Thanks for the improvement. Bruno