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