summaryrefslogtreecommitdiffstats
path: root/src/net/udp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/udp')
-rw-r--r--src/net/udp/tftp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c
index 889362a1..13734b0f 100644
--- a/src/net/udp/tftp.c
+++ b/src/net/udp/tftp.c
@@ -741,6 +741,11 @@ static int tftp_rx_data ( struct tftp_request *tftp,
rc = -EINVAL;
goto done;
}
+ if ( data->block == 0 ) {
+ DBGC ( tftp, "TFTP %p received data block 0\n", tftp );
+ rc = -EINVAL;
+ goto done;
+ }
/* Extract data */
block = ( ntohs ( data->block ) - 1 );