debian-000000_invalid-ip-range.patch 858 B

123456789101112131415161718192021222324
  1. Description: Fix segfault upon invalid IP range
  2. Author: Sergey Naumov
  3. Origin: http://patch-tracker.debian.org/patch/misc/dl/pptpd/1.3.4-5/pptpd.c
  4. Forwarded: http://sourceforge.net/mailarchive/forum.php?thread_name=1360193627%40msgid.manchmal.in-ulm.de&forum_name=poptop-server
  5. --- a/pptpd.c
  6. +++ b/pptpd.c
  7. @@ -735,6 +735,16 @@
  8. continue;
  9. }
  10. + if (upper < lower) {
  11. + /* if upper < lower segmantation fault in pptpctrl happens
  12. + * due to enabling pppLocal parameter without providing its value.
  13. + *
  14. + * we can safely use ipstr because it is not modified except
  15. + * of truncating.
  16. + */
  17. + syslog(LOG_ERR, "MGR: Bad %s IP range: %s", (type == LOCAL)?"local":"remote", ipstr);
  18. + exit(1);
  19. + }
  20. for (n = lower; n <= upper; n++) {
  21. sprintf(tmpstr5, "%s%d%s", ip_pre, n, ip_post);
  22. /* Check if the ip address is valid */