https://origsvn.digium.com/svn/asterisk/trunk
........
r218687 | dvossel | 2009-09-15 14:22:37 -0500 (Tue, 15 Sep 2009) | 2 lines
upward bound checking for port string to int conversion
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@218689
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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;
}