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 CFE9CC6379F for ; Fri, 13 Jan 2023 20:32:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 163048554E; Fri, 13 Jan 2023 21:32:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="nflhtAs1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E2C3854B2; Fri, 13 Jan 2023 18:27:48 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id 5CE3880EB7 for ; Fri, 13 Jan 2023 18:27:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=emohandesi@linux.microsoft.com Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 5C88B20DED16; Fri, 13 Jan 2023 09:27:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5C88B20DED16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673630865; bh=RSx1itUxCXRxXD1VhpWljOPGGfFbX8G9MY58B9hmjsU=; h=From:To:Cc:Subject:Date:From; b=nflhtAs1b4yWV8GPdfo+2SmUu0qRBI0X6t1BD4P1KR+Do5jJQEWkstm+cXkvlpCom 5xZoGkFAHwJuHJ+ms8yn/k9lvWLWBW9FpnwU+CPJMBWwiOZwpZj12cZev8bJuwpgOo 0q6vqkl5Jp+FRffzdJApYNBUYn7GlaE4DWvoyfuE= From: emohandesi@linux.microsoft.com To: u-boot@lists.denx.de Cc: joe.hershberger@ni.com, rfried.dev@gmail.com Subject: [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error Date: Fri, 13 Jan 2023 09:27:41 -0800 Message-Id: <1673630861-32383-1-git-send-email-emohandesi@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-Mailman-Approved-At: Fri, 13 Jan 2023 21:32:13 +0100 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.6 at phobos.denx.de X-Virus-Status: Clean From: Ehsan Mohandesi One extra character was being checked in the IPv6 string which caused the last character of the address to be neither '\0' nor ':'. This raises an error condition and causes the function to always return an error. This issue was resolved by this fix. Signed-off-by: Ehsan Mohandesi --- net/tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tftp.c b/net/tftp.c index c780c33..328fd90 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -837,7 +837,7 @@ void tftp_start(enum proto_t protocol) e = strchr(net_boot_file_name, ']'); len = e - s; if (s && e) { - string_to_ip6(s + 1, len, &tftp_remote_ip6); + string_to_ip6(s + 1, len - 1, &tftp_remote_ip6); strlcpy(tftp_filename, e + 2, MAX_LEN); } else { strlcpy(tftp_filename, net_boot_file_name, MAX_LEN); -- 1.8.3.1