From facd6c20c86806e2ed97444668f8c1dcb1e3fd72 Mon Sep 17 00:00:00 2001 From: Harrie Hazewinkel Date: Fri, 25 Jul 2003 07:32:39 +0000 Subject: [PATCH] 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) --- ext/snmp/snmp.c | 2 -- 1 file changed, 2 deletions(-) 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; -- 2.40.0