[asterisk-commits] dvossel: trunk r218687 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 15 14:22:42 CDT 2009


Author: dvossel
Date: Tue Sep 15 14:22:37 2009
New Revision: 218687

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=218687
Log:
upward bound checking for port string to int conversion

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=218687&r1=218686&r2=218687
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Sep 15 14:22:37 2009
@@ -3211,7 +3211,7 @@
 static int port_str2int(const char *pt, unsigned int standard)
 {
 	int port = standard;
-	if (ast_strlen_zero(pt) || (sscanf(pt, "%30d", &port) != 1) || (port < 0)) {
+	if (ast_strlen_zero(pt) || (sscanf(pt, "%30d", &port) != 1) || (port < 1) || (port > 65535)) {
 		port = standard;
 	}
 




More information about the asterisk-commits mailing list