Browse Source

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"
PEAR_1_4DEV
Harrie Hazewinkel 23 years ago
parent
commit
4d2229d6a3
  1. 2
      ext/snmp/snmp.c

2
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;

Loading…
Cancel
Save