Fixed buffer overflow with too long newsheader

This commit is contained in:
Michiel Broek
2003-09-02 20:25:42 +00:00
parent 43daa4cfbd
commit 8c2ce9da3b
21 changed files with 65 additions and 47 deletions

View File

@@ -692,7 +692,7 @@ void Reply_Email(int IsReply)
sLine();
for (i = 0; i < (TEXTBUFSIZE + 1); i++)
Message[i] = (char *) calloc(81, sizeof(char));
Message[i] = (char *) calloc(MAX_LINE_LENGTH +1, sizeof(char));
Line = 1;
Msg_New();
@@ -821,7 +821,7 @@ void Write_Email(void)
clear();
for (i = 0; i < (TEXTBUFSIZE + 1); i++)
Message[i] = (char *) calloc(81, sizeof(char));
Message[i] = (char *) calloc(MAX_LINE_LENGTH +1, sizeof(char));
Line = 1;
Msg_New();

View File

@@ -7,7 +7,7 @@
int Fs_Edit(void); /* The fullscreen message editor */
extern int Line; /* Number of lines + 1 */
extern char *Message[]; /* TEXTBUFSIZE lines of 80 chars */
extern char *Message[]; /* TEXTBUFSIZE lines of MAX_LINE_LENGTH chars */
int Row; /* Current row on screen */
int Col; /* Current column in text and on screen */

View File

@@ -410,7 +410,7 @@ void Post_Msg()
return;
for (i = 0; i < (TEXTBUFSIZE + 1); i++)
Message[i] = (char *) calloc(81, sizeof(char));
Message[i] = (char *) calloc(MAX_LINE_LENGTH +1, sizeof(char));
Line = 1;
Msg_New();
@@ -1321,7 +1321,7 @@ void Reply_Msg(int IsReply)
sLine();
for (i = 0; i < (TEXTBUFSIZE + 1); i++)
Message[i] = (char *) calloc(81, sizeof(char));
Message[i] = (char *) calloc(MAX_LINE_LENGTH +1, sizeof(char));
Msg_New();
strncpy(Msg.Replyid, msgid, 80);

View File

@@ -2280,7 +2280,7 @@ void QWK_Fetch()
colour(LIGHTBLUE, BLACK);
/* Processing BlueWave reply packet */
printf("%s\n", (char *)Language(459));
temp = calloc(2048, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
otemp = calloc(PATH_MAX, sizeof(char));
nWidth = 78;