}
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);
}
/* 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);
}