WC->ctdl_pid = serv_info.serv_pid;
break;
case 1:
- strcpy(serv_info.serv_nodename, buf);
+ safestrncpy(serv_info.serv_nodename, buf, sizeof serv_info.serv_nodename);
break;
case 2:
- strcpy(serv_info.serv_humannode, buf);
+ safestrncpy(serv_info.serv_humannode, buf, sizeof serv_info.serv_humannode);
break;
case 3:
- strcpy(serv_info.serv_fqdn, buf);
+ safestrncpy(serv_info.serv_fqdn, buf, sizeof serv_info.serv_fqdn);
break;
case 4:
- strcpy(serv_info.serv_software, buf);
+ safestrncpy(serv_info.serv_software, buf, sizeof serv_info.serv_software);
break;
case 5:
serv_info.serv_rev_level = atoi(buf);
break;
case 6:
- strcpy(serv_info.serv_bbs_city, buf);
+ safestrncpy(serv_info.serv_bbs_city, buf, sizeof serv_info.serv_bbs_city);
break;
case 7:
- strcpy(serv_info.serv_sysadm, buf);
+ safestrncpy(serv_info.serv_sysadm, buf, sizeof serv_info.serv_sysadm);
break;
case 9:
- strcpy(serv_info.serv_moreprompt, buf);
+ safestrncpy(serv_info.serv_moreprompt, buf, sizeof serv_info.serv_moreprompt);
break;
case 14:
serv_info.serv_supports_ldap = atoi(buf);
serv_getln(buf, sizeof buf);
if (fp != NULL) {
if (fgets(buf, SIZ, fp) == NULL)
- strcpy(buf, "000");
+ safestrncpy(buf, "000", sizeof buf);
buf[strlen(buf) - 1] = 0;
}
if (!strcmp(buf, "000")) {
int ch, a, pos;
pos = 0;
- strcpy(buf, "");
+ buf[0] = 0;
while (ptr[pos] != 0) {
ch = ptr[pos++];
&& (strlen(buf) > 1) )
buf[strlen(buf) - 1] = 0;
serv_puts(buf);
- strcpy(buf, "");
+ buf[0] = 0;
if (convert_to_html) {
strcat(buf, "<br />");
}
if ((ch == 32) && (strlen(buf) > 200)) {
buf[a] = 0;
serv_puts(buf);
- strcpy(buf, "");
+ buf[0] = 0;
}
if (strlen(buf) > 250) {
serv_puts(buf);
- strcpy(buf, "");
+ buf[0] = 0;
}
}
}
if (text == NULL) {
return(NULL);
}
- strcpy(text, "");
+ text[0] = 0;
bytes_allocated = SIZ;
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
serv_printf("CONF set");
serv_getln(buf, sizeof buf);
if (buf[0] != '4') {
- strcpy(WC->ImportantMessage, &buf[4]);
+ safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
display_siteconfig();
return;
}
serv_printf("SPEX mailboxes|%d|%d", atoi(bstr("mboxpolicy")), atoi(bstr("mboxvalue")));
serv_getln(buf, sizeof buf);
- strcpy(WC->ImportantMessage, "System configuration has been updated.");
+ safestrncpy(WC->ImportantMessage, "System configuration has been updated.",
+ sizeof WC->ImportantMessage);
display_siteconfig();
}
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
- strcpy(WC->ImportantMessage, &buf[4]);
+ safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
display_main_menu();
return;
}
serv_puts(enter_cmd);
serv_getln(buf, sizeof buf);
if (buf[0] != '4') {
- strcpy(WC->ImportantMessage, &buf[4]);
+ safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
display_main_menu();
return;
}
char buf[2];
len = 0;
- strcpy(strbuf, "");
+ strbuf[0] = 0;
do {
serv_read(&buf[0], 1);
ch = buf[0];
int count = 0;
int len = 0;
- strcpy(dest, "");
+ dest[0] = 0;
/* Locate desired parameter */
s = source;
struct tm *tm;
int hour;
- strcpy(buf, "");
+ buf[0] = 0;
tm = localtime(&thetime);
hour = tm->tm_hour;
if (hour == 0)
struct tm *tm;
int hour;
- strcpy(buf, "");
+ buf[0] = 0;
tm = localtime(&thetime);
hour = tm->tm_hour;
if (hour == 0)
{
struct tm *tm;
- strcpy(buf, "");
+ buf[0] = 0;
tm = localtime(&thetime);
sprintf(buf, "%s, %02d %s %4d %02d:%02d:%02d",
int i;
if (supplied_username != NULL) {
- strcpy(username, supplied_username);
+ safestrncpy(username, supplied_username, sizeof username);
}
else {
- strcpy(username, bstr("username") );
+ safestrncpy(username, bstr("username"), sizeof username);
}
serv_printf("AGUP %s", username);
is_new = atoi(bstr("is_new"));
if (strcasecmp(bstr("action"), "OK")) {
- strcpy(message, "Edit user cancelled.");
+ safestrncpy(message, "Edit user cancelled.", sizeof message);
}
else {
"%s<br /><br />\n", &buf[4]);
}
else {
- strcpy(message, "");
+ safestrncpy(message, "", sizeof message);
}
}
"%s<br /><br />\n", &buf[4]);
}
else {
- strcpy(message, "");
+ safestrncpy(message, "", sizeof message);
}
select_user_to_edit(message, bstr("username"));
}
char error_message[SIZ];
char username[SIZ];
- strcpy(username, bstr("username"));
+ safestrncpy(username, bstr("username"), sizeof username);
serv_printf("CREU %s", username);
serv_getln(buf, sizeof buf);