fixed buffer overflow bug. golded+ can crash in message list if size of name or subject is too big.

This commit is contained in:
Ianos Gnatiuc
2006-07-10 17:30:59 +00:00
parent 734e67d8b6
commit 9bb9d3abd8
3 changed files with 8 additions and 3 deletions

View File

@@ -221,9 +221,10 @@ void GMsgList::ReadMlst(int n) {
ml->written = msg.written;
ml->arrived = msg.arrived;
ml->received = msg.received;
strcpy(ml->by, msg.By());
strcpy(ml->to, msg.To());
strcpy(ml->re, msg.re);
strxcpy(ml->by, msg.By(), ARRAYSIZE(ml->by));
strxcpy(ml->to, msg.To(), ARRAYSIZE(ml->to));
strxcpy(ml->re, msg.re, ARRAYSIZE(ml->re));
{ Addr zero;
ml->colorby = GetColorName(ml->by, msg.orig, DEFATTR);