Prevent buffer overflow
This commit is contained in:
parent
2beffbd118
commit
d468f9d8d5
@ -247,7 +247,8 @@ void gareafile::ReadFMail(char* tag) {
|
|||||||
Path path, file;
|
Path path, file;
|
||||||
|
|
||||||
*file = NUL;
|
*file = NUL;
|
||||||
strcpy(options, tag);
|
options[79] = 0;
|
||||||
|
strncpy(options, tag, 79);
|
||||||
ptr = strtok(tag, " \t");
|
ptr = strtok(tag, " \t");
|
||||||
while(ptr) {
|
while(ptr) {
|
||||||
if(*ptr != '-') {
|
if(*ptr != '-') {
|
||||||
|
@ -41,7 +41,8 @@ void gareafile::ReadInterMail(char* tag) {
|
|||||||
char options[80];
|
char options[80];
|
||||||
|
|
||||||
*_path = NUL;
|
*_path = NUL;
|
||||||
strcpy(options, tag);
|
options[79] = 0;
|
||||||
|
strncpy(options, tag, 79);
|
||||||
|
|
||||||
char* ptr = strtok(tag, " \t");
|
char* ptr = strtok(tag, " \t");
|
||||||
while(ptr) {
|
while(ptr) {
|
||||||
|
@ -96,7 +96,8 @@ void gareafile::ReadQEcho(char* tag) {
|
|||||||
|
|
||||||
*origin = NUL;
|
*origin = NUL;
|
||||||
*file = NUL;
|
*file = NUL;
|
||||||
strcpy(options, tag);
|
options[79] = 0;
|
||||||
|
strncpy(options, tag, 79);
|
||||||
char* ptr = strtok(tag, " \t");
|
char* ptr = strtok(tag, " \t");
|
||||||
while(ptr) {
|
while(ptr) {
|
||||||
if(*ptr != '-')
|
if(*ptr != '-')
|
||||||
|
@ -161,8 +161,9 @@ void gareafile::ReadAdeptXBBS(char* tag) {
|
|||||||
Path file, path, cfg;
|
Path file, path, cfg;
|
||||||
|
|
||||||
*path = NUL;
|
*path = NUL;
|
||||||
|
options[79] = 0;
|
||||||
strcpy(cfg, "System\\Message_Areas");
|
strcpy(cfg, "System\\Message_Areas");
|
||||||
strcpy(options, tag);
|
strncpy(options, tag, 79);
|
||||||
char* ptr = strtok(tag, " \t");
|
char* ptr = strtok(tag, " \t");
|
||||||
while(ptr) {
|
while(ptr) {
|
||||||
if(*ptr != '-')
|
if(*ptr != '-')
|
||||||
|
Reference in New Issue
Block a user