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)) { /*