From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1530 invoked from network); 15 Aug 2022 18:08:27 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 15 Aug 2022 18:08:27 -0000 Received: (qmail 1417 invoked by uid 550); 15 Aug 2022 18:08:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1382 invoked from network); 15 Aug 2022 18:08:24 -0000 X-Virus-Scanned: SPAM Filter at disroot.org From: =?UTF-8?q?=C3=89rico=20Nogueira?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1660586890; bh=BRvTm0Lp9Gw81HrsVXqDcH+DUy/zw2/KE29XxMRp5ng=; h=From:To:Cc:Subject:Date; b=WIxlRFUNzUoRTOeTDbirOoB2DemGg8I77P71N1HiVZ2k5Geh71IjinOB8M1/nWmZu jVE61zUWli2Ow1PYBToth3Jj5KBZR2zxmJk7BxAL0ZDf/ICbVmi/gDfogdmXQP+5dw dFKiwhjPiiB9pwCGU+D/ul4BdvoyArRZud7LiDWMFBHZW7iBW3Qa02tMx5tLCNi2Kk oQaJHFF+2lVqgeMVFdvIOne4t+qWo1TTAZ4YB88hn8SOAEv7pZEkQRwi0zcHUcHEf4 fJTNsBd42DEU9wCP6/fk5Gl5FMctIWQ/dMbyyJFhPEI6ibvpDzk2LRwYPzvnjat3CB uLHx9Ad4eaqxg== To: musl@lists.openwall.com Cc: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 15 Aug 2022 15:07:46 -0300 Message-Id: <20220815180746.2324-1-ericonr@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH] make exit condition clearer in fixup_rpath breaking out of the switch-case when l==-1 means the conditional below will necessarily be true (-1 >= buf_size, a size_t variable) and the function will return 0. it is, however, somewhat unclear that that's what's happening. simply returning there is simpler --- ldso/dynlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/dynlink.c b/ldso/dynlink.c index cc677952..fb77b092 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -868,7 +868,7 @@ static int fixup_rpath(struct dso *p, char *buf, size_t buf_size) case ENOENT: case ENOTDIR: case EACCES: - break; + return 0; default: return -1; } -- 2.37.2