}
} else if (STREQ(token, "server")) {
token = GetArguments("server", true);
- strncpy(wmnotify_infos.server_name, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.server_name, token, MAX_STR_LEN - 1);
+ wmnotify_infos.server_name[
+ sizeof(wmnotify_infos.server_name) - 1] = '\0';
server_found = true;
} else if (STREQ(token, "port")) {
token = GetArguments("port", true);
else if (STREQ(token, "username")) {
token = GetArguments("username", true);
- strncpy(wmnotify_infos.username, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.username, token, MAX_STR_LEN - 1);
+ wmnotify_infos.username[
+ sizeof(wmnotify_infos.username) - 1] = '\0';
username_found = true;
} else if (STREQ(token, "password")) {
token = GetArguments("password", true);
- strncpy(wmnotify_infos.password, token,
- MAX_STR_LEN);
+ strncpy(wmnotify_infos.password, token, MAX_STR_LEN - 1);
+ wmnotify_infos.password[
+ sizeof(wmnotify_infos.password) - 1] = '\0';
password_found = true;
} else if (STREQ(token, "mailcheckdelay")) {
int delay; /* delay in minutes. */