From dc5e9a2b16b72561cc928161b6fa7b76bd9cd618 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Wed, 22 Dec 2004 16:13:12 +0000 Subject: [PATCH] Small fixes for add file --- ChangeLog | 1 + mbsebbs/filesub.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a27e4a7f..d4799e5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ v0.71.1 28-Nov-2004 Added #define NFGVMIN 1 in openport. During hangup we set sighup to ignore. Made zmodem-8k downloads work again. + Some small buffer protections added in addfile. mbnewuser: During hangup we set sighup to ignore. diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index 4a0fb8aa..fd824639 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -851,14 +851,14 @@ int Addfile(char *File, int AreaNum, int fileid) } memset(&fdb, 0, fdbhdr.recsize); - strcpy(fdb.LName, File); /* LFN, currently real file */ + strncpy(fdb.LName, File, 80); /* LFN, currently real file */ strcpy(temp1, File); name_mangle(temp1); - strcpy(fdb.Name, temp1); /* 8.3 name */ + strncpy(fdb.Name, temp1, 12); /* 8.3 name */ fdb.Size = (long)(statfile.st_size); fdb.FileDate = statfile.st_mtime; fdb.Crc32 = file_crc(Filename, TRUE); - strcpy(fdb.Uploader, exitinfo.sUserName); + strncpy(fdb.Uploader, exitinfo.sUserName, 35); fdb.UploadDate = time(NULL); if (strcmp(fdb.Name, fdb.LName)) { /*