diff options
Diffstat (limited to 'src/net/udp/tftp.c')
| -rw-r--r-- | src/net/udp/tftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index f3cb34342..4255472ee 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -325,7 +325,7 @@ void tftp_set_mtftp_port ( unsigned int port ) { * @ret rc Return status code */ static int tftp_send_rrq ( struct tftp_request *tftp ) { - const char *path = tftp->uri->path; + const char *path = ( tftp->uri->path + 1 /* skip '/' */ ); struct tftp_rrq *rrq; size_t len; struct io_buffer *iobuf; @@ -1067,6 +1067,8 @@ static int tftp_core_open ( struct interface *xfer, struct uri *uri, return -EINVAL; if ( ! uri->path ) return -EINVAL; + if ( uri->path[0] != '/' ) + return -EINVAL; /* Allocate and populate TFTP structure */ tftp = zalloc ( sizeof ( *tftp ) ); |
