mirror of the now-defunct rocklinux.org
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.

49 lines
1.9 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/netkit-telnet/slc_add_reply.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. diff -Naur netkit-telnet-0.17.orig/telnet/telnet.cc netkit-telnet-0.17/telnet/telnet.cc
  20. --- netkit-telnet-0.17.orig/telnet/telnet.cc 2000-07-23 04:24:53.000000000 +0100
  21. +++ netkit-telnet-0.17/telnet/telnet.cc 2005-10-11 11:58:02.000000000 +0100
  22. @@ -1050,6 +1050,7 @@
  23. unsigned char slc_reply[128];
  24. +unsigned char const * const slc_reply_eom = &slc_reply[sizeof(slc_reply)];
  25. unsigned char *slc_replyp;
  26. void slc_start_reply(void) {
  27. @@ -1061,6 +1062,18 @@
  28. }
  29. void slc_add_reply(int func, int flags, int value) {
  30. + /* Fix security vulnerability
  31. + * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0469
  32. + *
  33. + * A sequence of up to 6 bytes my be written for this member of the
  34. + * SLC suboption list by this function. The end of negotiation
  35. + * command, which is written by slc_end_reply(), will require 2
  36. + * additional bytes. Do not proceed unless there is sufficient
  37. + * space for these items.
  38. + */
  39. + if (&slc_replyp[6+2] > slc_reply_eom)
  40. + return;
  41. +
  42. if ((*slc_replyp++ = func) == IAC)
  43. *slc_replyp++ = IAC;
  44. if ((*slc_replyp++ = flags) == IAC)