aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-10 16:03:59 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-10 16:03:59 +0100
commitb4694a17a84a0c1612c1ea07c6cd57c193995328 (patch)
tree09a96d251441ad1d4d34344d68ef6f299a7f52d1
parent9d2d1c17c9dbe52f14f32accb6116cf53409676f (diff)
Fixed possible buffer overflows
-rw-r--r--FICS/talkproc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c
index ef96758..a04f0bb 100644
--- a/FICS/talkproc.c
+++ b/FICS/talkproc.c
@@ -736,7 +736,7 @@ com_mailmess(int p, param_list param)
char filename[MAX_FILENAME_SIZE];
char fname[MAX_FILENAME_SIZE];
char mdir[MAX_FILENAME_SIZE];
- char subj[81];
+ char subj[120];
if (!parray[p].registered) {
pprintf(p, "Only registered people can use the mailmess "
@@ -748,9 +748,9 @@ com_mailmess(int p, param_list param)
sprintf(mdir, "%s/player_data/%c/", stats_dir, parray[p].login[0]);
if (search_directory(mdir, filename, buffer, 1000)) {
- sprintf(subj, "Your FICS messages from server %s",
+ snprintf(subj, sizeof subj, "Your FICS messages from server %s",
fics_hostname);
- sprintf(fname, "%s/%s", mdir, filename);
+ snprintf(fname, sizeof fname, "%s/%s", mdir, filename);
mail_file_to_user(p, subj, fname);
pprintf(p, "Messages sent to %s\n", parray[p].emailAddress);
} else {