Fixed a buffer overflow when processing TIC files with a lot of garabage in it

This commit is contained in:
Michiel Broek 2007-05-16 19:41:39 +00:00
parent 6821829f83
commit 06f53854e2
2 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,8 @@ v0.91.8 26-Apr-2007
Added mbtask commands to update the MIB counters. Added mbtask commands to update the MIB counters.
Fixed mbfile import with too many description lines in Fixed mbfile import with too many description lines in
files.bbs files.bbs
Fixed a buffer overflow when processing TIC files with a lot
of garbage in it.
mbnewusr: mbnewusr:
Fixed loading default language for new user. Fixed loading default language for new user.

View File

@ -375,8 +375,10 @@ int LoadTic(char *inb, char *tfn, orphans **opl)
* If we didn't find a matching keyword it is a line we * If we didn't find a matching keyword it is a line we
* will just remember and forward if there are downlinks. * will just remember and forward if there are downlinks.
*/ */
if (TIC.TicIn.Unknowns < 25) { if (strlen(Temp) > 127) {
strcpy(TIC.TicIn.Unknown[TIC.TicIn.Unknowns], Temp); Syslog('+', "Unknown too long TIC line dropped");
} else if (TIC.TicIn.Unknowns < 25) {
strncpy(TIC.TicIn.Unknown[TIC.TicIn.Unknowns], Temp, 127);
TIC.TicIn.Unknowns++; TIC.TicIn.Unknowns++;
} }
} }