From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 118793858413 for ; Mon, 25 Mar 2024 08:45:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 118793858413 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 118793858413 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711356309; cv=none; b=UgOLXY37gNImneAW3JvFDsb4J9EF1E7jZmm3tqwEZmZjR3hIFFF0UprOjegd3FeEy3c2M/G8CoyIYgbaEV1NKJKhfvNVutpMNperXM2vO+Ew0mrnaZ70VC5ZnXelZas1LUGNyz1c9ne4hiceEmmxPsHj+uglBSha90nFBGHw1Gw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711356309; c=relaxed/simple; bh=es9TOIw8DeKZMObjVy6FmoSw9XlKW7YvWqsfCL/TK3M=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=s+daet/gkZQzy7cKIpBNYJ+hTM2ZUW6D7h3rN8uYq3ZZgYZGIlgs7NHTgXebQmy10iXzOTiH6NLd7vhnhIY6aynuWz5102Zmrv+Ia7TDUSHkeA+P9o5B1v/N3QkTFT1rx03/C/akDmPcEyGh9FsA+fTyBKHGd7iBWKRC8/fEN0E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by smtp-out1.suse.de (Postfix) with ESMTP id 848BA34F64; Mon, 25 Mar 2024 08:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711356303; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fC+Zv0i0X7u+R72bFvud/f+tJhEck5n0fCbWEljEGSc=; b=pBOzGe2W+Yi5VtUze/VYNbIRkT9OU6U4MPS4VG7pKvFBVBgxbsGN4OLRucU2XxQBs/GLov gG635585ke+M5o1yTdn5RcnM065K2tkDmUlTDGyMvS8zTYoyuKYnzuplmu1L/H2+YcV8JR B9AmhkVwnUgGRAr4x8aFz+XHnOMolEo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711356303; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fC+Zv0i0X7u+R72bFvud/f+tJhEck5n0fCbWEljEGSc=; b=T/jAWMCC1E3U4dZhiidYpGZRKKoJlMFKPr3I2E2qUkSLqOoyTXSRawHCatwkojAvshXNT+ n7oDVjsB4B75xWCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711356303; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fC+Zv0i0X7u+R72bFvud/f+tJhEck5n0fCbWEljEGSc=; b=pBOzGe2W+Yi5VtUze/VYNbIRkT9OU6U4MPS4VG7pKvFBVBgxbsGN4OLRucU2XxQBs/GLov gG635585ke+M5o1yTdn5RcnM065K2tkDmUlTDGyMvS8zTYoyuKYnzuplmu1L/H2+YcV8JR B9AmhkVwnUgGRAr4x8aFz+XHnOMolEo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711356303; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fC+Zv0i0X7u+R72bFvud/f+tJhEck5n0fCbWEljEGSc=; b=T/jAWMCC1E3U4dZhiidYpGZRKKoJlMFKPr3I2E2qUkSLqOoyTXSRawHCatwkojAvshXNT+ n7oDVjsB4B75xWCQ== Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id 75CBE4A052A; Mon, 25 Mar 2024 09:45:03 +0100 (CET) From: Andreas Schwab To: Job Snijders Cc: Florian Weimer , libc-alpha@sourceware.org Subject: Re: [PATCH] resolv: add IPv6 support to inet_net_pton() In-Reply-To: (Job Snijders's message of "Fri, 22 Mar 2024 04:16:28 +0000") References: <87zfuxcdjd.fsf@oldenburg.str.redhat.com> X-Yow: When this load is DONE I think I'll wash it AGAIN.. Date: Mon, 25 Mar 2024 09:45:03 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.11 X-Spamd-Result: default: False [-0.11 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(2.92)[0.972]; NEURAL_HAM_LONG(-1.00)[-0.998]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-1.92)[94.60%] X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mär 22 2024, Job Snijders wrote: > The above to me means that it is not enough to just check whether errno > is set to ERANGE, but one also has to check whether LONG_MAX or LONG_MIN > were returned. It's an 'AND' operation. That is irrelevant. > Then, if errno is NOT set to ERANGE, then we have to additionally check > whether the value is within contextual bounds. By checking the range you already know that the value is neither LONG_MAX nor LONG_MIN, thus the errno value does not matter. This is simple logic. > So I don't think it is correct to skimp on checks here, to me idiomatic > checks do not equate 'bad'. A source analyzer will likely flag it, which makes it even worse. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."