]> 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>
Thu, 24 Jul 2003 21:48:55 +0000 (21:48 +0000)
committerHarrie Hazewinkel <harrie@php.net>
Thu, 24 Jul 2003 21:48:55 +0000 (21:48 +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"

ext/snmp/snmp.c

index 8ab63897f344bcd76aafa7519306084765a60fd4..273fbc4699d9058e5e5adbf78acd6a04663e9f6e 100644 (file)
@@ -580,7 +580,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;
@@ -906,7 +905,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;