Prevent buffer overflow

This commit is contained in:
Stas Degteff 2005-12-08 18:48:15 +00:00
parent 2beffbd118
commit d468f9d8d5
4 changed files with 8 additions and 4 deletions

View File

@ -247,7 +247,8 @@ void gareafile::ReadFMail(char* tag) {
Path path, file;
*file = NUL;
strcpy(options, tag);
options[79] = 0;
strncpy(options, tag, 79);
ptr = strtok(tag, " \t");
while(ptr) {
if(*ptr != '-') {

View File

@ -41,7 +41,8 @@ void gareafile::ReadInterMail(char* tag) {
char options[80];
*_path = NUL;
strcpy(options, tag);
options[79] = 0;
strncpy(options, tag, 79);
char* ptr = strtok(tag, " \t");
while(ptr) {

View File

@ -96,7 +96,8 @@ void gareafile::ReadQEcho(char* tag) {
*origin = NUL;
*file = NUL;
strcpy(options, tag);
options[79] = 0;
strncpy(options, tag, 79);
char* ptr = strtok(tag, " \t");
while(ptr) {
if(*ptr != '-')

View File

@ -161,8 +161,9 @@ void gareafile::ReadAdeptXBBS(char* tag) {
Path file, path, cfg;
*path = NUL;
options[79] = 0;
strcpy(cfg, "System\\Message_Areas");
strcpy(options, tag);
strncpy(options, tag, 79);
char* ptr = strtok(tag, " \t");
while(ptr) {
if(*ptr != '-')