02-fix-invalid-read-in-tftp_send_request.patch 396 B

12345678910111213
  1. diff --git a/tftp_io.c b/tftp_io.c
  2. index 605a9c2..6cce1f4 100644
  3. --- a/tftp_io.c
  4. +++ b/tftp_io.c
  5. @@ -64,7 +64,7 @@ int tftp_send_request(int socket, struct sockaddr_storage *sa, short type,
  6. buf_index += strlen(mode);
  7. buf_index++;
  8. - for (i = 2; ; i++)
  9. + for (i = 2; i < OPT_NUMBER; i++)
  10. {
  11. if (strlen(tftp_options[i].option) == 0)
  12. break;