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:
parent
a41b4c2708
commit
c373c8807e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue