summaryrefslogtreecommitdiffstats
path: root/net/atftp/patches/02-fix-invalid-read-in-tftp_send_request.patch
blob: 679af5cf3f0a96b997e091425a187a87cd3e88ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tftp_io.c b/tftp_io.c
index 605a9c2..6cce1f4 100644
--- a/tftp_io.c
+++ b/tftp_io.c
@@ -64,7 +64,7 @@ int tftp_send_request(int socket, struct sockaddr_storage *sa, short type,
      buf_index += strlen(mode);
      buf_index++;
      
-     for (i = 2; ; i++)
+     for (i = 2; i < OPT_NUMBER; i++)
      {
           if (strlen(tftp_options[i].option) == 0)
                break;