upward bound checking for port string to int conversion

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David Vossel 2009-09-15 19:22:37 +00:00
parent a41b4c2708
commit c373c8807e
1 changed files with 1 additions and 1 deletions

View File

@ -3211,7 +3211,7 @@ static int proxy_update(struct sip_proxy *proxy)
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;
}