Message ID | 20220308100717.1006126-13-siddhesh@sourceware.org |
---|---|
State | New |
Headers | show
Return-Path: <libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=cdTEcAvP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=<UNKNOWN>) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCWPl4Mx7z9sGL for <incoming@patchwork.ozlabs.org>; Tue, 8 Mar 2022 21:13:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 39C8B385AC32 for <incoming@patchwork.ozlabs.org>; Tue, 8 Mar 2022 10:13:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39C8B385AC32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646734425; bh=6yKM17nxKvO4525e7lbmpg3vR7MhwbtJW5i+qk/d0bA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cdTEcAvPxQgVheluKZ/4PBSiPdxmGpZ32u+Gwvup0cD/yLw2qpl05OlI/8dHyYx5w OXNUtRBuMjbZxlHSPi7UGEWKsvKnY6DPJg93cBWJMOlRIUVKl2bqINYVSRHiPqBnUW VbB64hLnpFuxe7/cK9ioPaHi6yMRs3lpVA8IyEhg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from quail.birch.relay.mailchannels.net (quail.birch.relay.mailchannels.net [23.83.209.151]) by sourceware.org (Postfix) with ESMTPS id BA357385741B for <libc-alpha@sourceware.org>; Tue, 8 Mar 2022 10:08:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA357385741B X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B06CD921C25; Tue, 8 Mar 2022 10:08:24 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9C514922337; Tue, 8 Mar 2022 10:08:14 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1646734103; a=rsa-sha256; cv=none; b=wrCQF4mMpYlQ/AP3DOmW1v4mTqtMh56RPMlWh6TRMDsFsnQj+ep2NosixtYiRp2ErIbyVf G12ZY2f+88f2hBXFuEFTwjMNuqcyy8sCqRLP/wQFSJPiJNraDB8AoC8uQdfH7dWihJZa49 jmkZzYfnRxbhHwRGVn0xvfwoQsWnmjNgu4E3/DnGVIZugVzovMicnQIu43JBjFy/8I2/Ms x2fWEYcoQokOZ3t2OkZORAd121C9UVOFfztHYhGNCXH8jHeqm57S8R2LNpwkKoyJIH9MaI Koot1544PpbhzmiIfG7UyTnw8BlpQTE45CxrVGJJ5YFmfgdpjfMRu0bRfD8iew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1646734103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6yKM17nxKvO4525e7lbmpg3vR7MhwbtJW5i+qk/d0bA=; b=4+LfgX76K+dHInDE5RWK58RH2lhgNxGvFJ4YYlDMhjnpNaFbXPt0n67LEiR08FiRBNcGLf +MaphcDy6Ds3U2kQEQhCjFUxOpl1pvm0e+TyX2zn5wyEIF81me+Onnd98Rs7TAgKjMjeDM S4rt0B5ebPfa//wUFF2XM2f3/PCa6dTiI9wAn4qWmSwIMUSB3ok7D08md2Bssij6ewBOyu 3hFNmeB32ar9IqVMsS7hl/RbpD6o29k9ARPxrXJ+bgg9/ERoIvo5iD5lUN/JEmVjwV+t/W 6chSA/jWLMzfF45QbLIwraeYSv2+VeGDzuu48pJobAdZuUctepYagmvHLTmZ+g== ARC-Authentication-Results: i=1; rspamd-c9cb649d9-nvpxh; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@sourceware.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.124.31.75 (trex/6.5.3); Tue, 08 Mar 2022 10:08:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Interest-Duck: 10dfe6f572cd89d8_1646734104527_1626133179 X-MC-Loop-Signature: 1646734104526:44038372 X-MC-Ingress-Time: 1646734104526 Received: from rhbox.redhat.com (unknown [1.186.224.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4KCWHF3Whqz1Pr; Tue, 8 Mar 2022 02:08:09 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 12/12] gethosts: Return EAI_MEMORY on allocation failure Date: Tue, 8 Mar 2022 15:37:17 +0530 Message-Id: <20220308100717.1006126-13-siddhesh@sourceware.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220308100717.1006126-1-siddhesh@sourceware.org> References: <20220308100717.1006126-1-siddhesh@sourceware.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3493.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Siddhesh Poyarekar <siddhesh@sourceware.org> Cc: fweimer@redhat.com Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org> |
Series |
getaddrinfo facelift and fixes
|
expand
|
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 6cbbd5dac1..7c7565ac6d 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -303,13 +303,13 @@ gethosts (nss_gethostbyname3_r fct, int family, const char *name, else if (status == NSS_STATUS_SUCCESS) { if (!convert_hostent_to_gaih_addrtuple (req, family, &th, res)) - return -EAI_SYSTEM; + return -EAI_MEMORY; if (localcanon != NULL && res->canon == NULL) { char *canonbuf = __strdup (localcanon); if (canonbuf == NULL) - return -EAI_SYSTEM; + return -EAI_MEMORY; res->canon = canonbuf; } }
All other cases of failures due to lack of memory return EAI_MEMORY, so it seems wrong to return EAI_SYSTEM here. The only reason convert_hostent_to_gaih_addrtuple could fail is on calloc failure. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> --- sysdeps/posix/getaddrinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)