You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
744 B

  1. Subject: Fix incorrect data size check for UDP.
  2. Author: Luca Bigliardi <shammash@artha.org>
  3. Bug-Debian; http://bugs.debian.org/546590
  4. Last-Update: 2009-09-19
  5. --- a/parseoptions.c
  6. +++ b/parseoptions.c
  7. @@ -606,9 +606,12 @@ int parse_options(int argc, char **argv)
  8. if (opt_numeric == TRUE) opt_gethost = FALSE;
  9. /* some error condition */
  10. - if (data_size+IPHDR_SIZE+TCPHDR_SIZE > 65535) {
  11. + if (data_size+IPHDR_SIZE+
  12. + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE) > 65535) {
  13. printf("Option error: sorry, data size must be <= %lu\n",
  14. - (unsigned long)(65535-IPHDR_SIZE+TCPHDR_SIZE));
  15. + (unsigned long)(65535-(IPHDR_SIZE+
  16. + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE)))
  17. + );
  18. exit(1);
  19. }
  20. else if (count <= 0 && count != -1) {