public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error
@ 2023-01-13 17:27 emohandesi
  2023-01-16 12:01 ` Vyacheslav V. Mitrofanov
  2023-02-03 18:20 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: emohandesi @ 2023-01-13 17:27 UTC (permalink / raw)
  To: u-boot; +Cc: joe.hershberger, rfried.dev

From: Ehsan Mohandesi <emohandesi@microsoft.com>

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error
  2023-01-13 17:27 [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error emohandesi
@ 2023-01-16 12:01 ` Vyacheslav V. Mitrofanov
  2023-02-03 18:20 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Vyacheslav V. Mitrofanov @ 2023-01-16 12:01 UTC (permalink / raw)
  To: u-boot@lists.denx.de, emohandesi@linux.microsoft.com
  Cc: joe.hershberger@ni.com, rfried.dev@gmail.com

On Fri, 2023-01-13 at 09:27 -0800, emohandesi@linux.microsoft.com
wrote:
> From: Ehsan Mohandesi <emohandesi@microsoft.com>
> 
> 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>
> ---
>  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);
Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error
  2023-01-13 17:27 [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error emohandesi
  2023-01-16 12:01 ` Vyacheslav V. Mitrofanov
@ 2023-02-03 18:20 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2023-02-03 18:20 UTC (permalink / raw)
  To: emohandesi; +Cc: u-boot, joe.hershberger, rfried.dev

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

On Fri, Jan 13, 2023 at 09:27:41AM -0800, emohandesi@linux.microsoft.com wrote:

> From: Ehsan Mohandesi <emohandesi@microsoft.com>
> 
> 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>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-03 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-13 17:27 [PATCH] net: ipv6: Fixed IPv6 string to address conversion off-by-one error emohandesi
2023-01-16 12:01 ` Vyacheslav V. Mitrofanov
2023-02-03 18:20 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox