From 4d2229d6a3743715be0deb12d7c49a60452a5dc6 Mon Sep 17 00:00:00 2001 From: Harrie Hazewinkel Date: Thu, 24 Jul 2003 21:48:55 +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" --- ext/snmp/snmp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 8ab63897f3..273fbc4699 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -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; -- 2.40.0