1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00

Fixed possible overflow.

This commit is contained in:
Ilia Alshanetsky
2004-02-03 03:10:28 +00:00
parent 538d5199ea
commit 6dca37c50c
+2 -2
View File
@@ -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);
}