From a292bc77ba3bd3d649c4faf3a03fa7902555627a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 5 Feb 2016 07:55:28 -0500 Subject: [PATCH] fix issue #362 , add bounds check to su3 fileNameLength --- Reseed.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Reseed.cpp b/Reseed.cpp index 6d7c7901..80cc6a45 100644 --- a/Reseed.cpp +++ b/Reseed.cpp @@ -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];