summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEhsan Mohandesi <emohandesi@microsoft.com>2023-01-13 09:27:41 -0800
committerTom Rini <trini@konsulko.com>2023-02-02 14:44:53 -0500
commit7db25d99b21ae7b2a04153a93afe7692c86992ac (patch)
tree591c0be13f7533905c68d715cdeed0d9d0a2536a /net
parent796e549822bdb49128578d8ae82d28a5249b4816 (diff)
downloadu-boot-7db25d99b21ae7b2a04153a93afe7692c86992ac.tar.gz
u-boot-7db25d99b21ae7b2a04153a93afe7692c86992ac.tar.bz2
u-boot-7db25d99b21ae7b2a04153a93afe7692c86992ac.zip
net: ipv6: Fixed IPv6 string to address conversion off-by-one error
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 <emohandesi@microsoft.com> Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 51e062bddf..88e71e67de 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -845,7 +845,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);