From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F4D0C2BD09 for ; Mon, 24 Jun 2024 12:52:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F2B8883B1; Mon, 24 Jun 2024 14:52:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9B7C9882B7; Mon, 24 Jun 2024 08:25:29 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AF4AD8819D for ; Mon, 24 Jun 2024 08:25:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=jhumphreysti@gmail.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45O6PJDi082403; Mon, 24 Jun 2024 01:25:19 -0500 Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45O6PJCA128817 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 24 Jun 2024 01:25:19 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 24 Jun 2024 01:25:19 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 24 Jun 2024 01:25:19 -0500 Received: from localhost (udb0321960.dhcp.ti.com [128.247.81.241]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45O6PJXb027110; Mon, 24 Jun 2024 01:25:19 -0500 From: Jon Humphreys To: Jerome Forissier , CC: Ilias Apalodimas , Javier Tia , Maxim Uvarov , "Jerome Forissier" , Tom Rini , Simon Glass , Mattijs Korpershoek , AKASHI Takahiro , Michal Simek , Francis Laniel , Peter Robinson Subject: Re: [PATCH v4 10/14] net-lwip: add wget command In-Reply-To: <86frt2vp2k.fsf@udb0321960.dhcp.ti.com> References: <86frt2vp2k.fsf@udb0321960.dhcp.ti.com> Date: Mon, 24 Jun 2024 01:25:19 -0500 Message-ID: <86cyo6vovk.fsf@udb0321960.dhcp.ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Mon, 24 Jun 2024 14:52:21 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Subject: [PATCH] net-lwip: fixes off-by-one array access error with wget When wget parses the url and extracts the host, it is off by one on the index to terminate the character array. Signed-off-by: Jonathan Humphreys --- net-lwip/wget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-lwip/wget.c b/net-lwip/wget.c index 069299bd469..63b19b99112 100644 --- a/net-lwip/wget.c +++ b/net-lwip/wget.c @@ -51,7 +51,7 @@ static int parse_url(char *url, char *host, u16 *port, char **path) return -EINVAL; memcpy(host, p, pp - p); - host[pp - p + 1] = '\0'; + host[pp - p] = '\0'; if (*pp == ':') { /* Parse port number */ -- 2.34.1