From: Harrie Hazewinkel Date: Fri, 25 Jul 2003 07:32:39 +0000 (+0000) Subject: Bug 24760 fix, in which the port number when non-default is not handled X-Git-Tag: php-4.3.3RC2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=facd6c20c86806e2ed97444668f8c1dcb1e3fd72;p=php Bug 24760 fix, in which the port number when non-default is not handled correctly and ends up as the default port. This seems to be caused by some buffer overflow where the port number is assign zero, even though it it is not assigned to the port variable. Fix was reported and a fix proposed by "chuck+php at 2003 dot snew dot com" (Bugfixing branch) --- diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 6f60f9fdd8..60e1c9e671 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -575,7 +575,6 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) strcpy (hostname, Z_STRVAL_PP(a1)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); - *pptr = 0; } session.peername = hostname; @@ -892,7 +891,6 @@ static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) strcpy(hostname, Z_STRVAL_PP(a1)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); - *pptr = 0; } session.peername = hostname; session.remote_port = remote_port;