]> granicus.if.org Git - php/commitdiff
Bug 24760 fix, in which the port number when non-default is not handled
authorHarrie Hazewinkel <harrie@php.net>
Fri, 25 Jul 2003 07:32:39 +0000 (07:32 +0000)
committerHarrie Hazewinkel <harrie@php.net>
Fri, 25 Jul 2003 07:32:39 +0000 (07:32 +0000)
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)

ext/snmp/snmp.c

index 6f60f9fdd811e5211c94231ed25a263606e834a7..60e1c9e6718fd773fd1f67df06cc50440097b8b9 100644 (file)
@@ -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;