From: Michael Brown Date: Thu, 31 Mar 2011 03:52:47 +0000 (+0100) Subject: [tftp] Avoid setting current working URI to "tftp://0.0.0.0/" X-Git-Tag: v1.20.1~2161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58dcb2e15e2da84c6bdd7313ac6b090748474cce;p=thirdparty%2Fipxe.git [tftp] Avoid setting current working URI to "tftp://0.0.0.0/" Set the current working URI to NULL rather than to "tftp://0.0.0.0/". Reported-by: Piotr JaroszyƄski Signed-off-by: Michael Brown --- diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index f4e9f4c61..7cd211e41 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -1245,11 +1245,15 @@ static int tftp_apply_settings ( void ) { * applicators. */ if ( tftp_server.s_addr != last_tftp_server.s_addr ) { - snprintf ( uri_string, sizeof ( uri_string ), - "tftp://%s/", inet_ntoa ( tftp_server ) ); - uri = parse_uri ( uri_string ); - if ( ! uri ) - return -ENOMEM; + if ( tftp_server.s_addr ) { + snprintf ( uri_string, sizeof ( uri_string ), + "tftp://%s/", inet_ntoa ( tftp_server ) ); + uri = parse_uri ( uri_string ); + if ( ! uri ) + return -ENOMEM; + } else { + uri = NULL; + } churi ( uri ); uri_put ( uri ); }