From: Ilia Alshanetsky Date: Tue, 3 Feb 2004 03:10:28 +0000 (+0000) Subject: Fixed possible overflow. X-Git-Tag: php-5.0.0b4RC1~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dca37c50c399ed619bb5287c3f3afdfb2f9b84d;p=php Fixed possible overflow. --- diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index ec1f0abb2b..94046f2034 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -582,7 +582,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) } snmp_sess_init(&session); - strcpy (hostname, Z_STRVAL_PP(a1)); + strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); } @@ -907,7 +907,7 @@ static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) /* Reading the hostname and its optional non-default port number */ convert_to_string_ex(a1); - strcpy(hostname, Z_STRVAL_PP(a1)); + strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); }