fix issue #362 , add bounds check to su3 fileNameLength

This commit is contained in:
Jeff Becker 2016-02-05 07:55:28 -05:00
parent 98d5e0b56d
commit a292bc77ba
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B

View File

@ -208,6 +208,11 @@ namespace data
uint16_t fileNameLength, extraFieldLength;
s.read ((char *)&fileNameLength, 2);
fileNameLength = le16toh (fileNameLength);
if ( fileNameLength > 255 ) {
// too big
LogPrint(eLogError, "Reseed: SU3 fileNameLength too large: ", fileNameLength);
return numFiles;
}
s.read ((char *)&extraFieldLength, 2);
extraFieldLength = le16toh (extraFieldLength);
char localFileName[255];