fix for potential segv

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@51 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
redpony 2006-07-11 15:09:04 +00:00
parent 20344c0008
commit bf3caff97e

View File

@ -36,7 +36,8 @@ public:
{
using namespace boost::iostreams;
if (filePath.substr(filePath.size() - 3, 3) == ".gz")
if (filePath.size() > 3 &&
filePath.substr(filePath.size() - 3, 3) == ".gz")
{
m_file.open(filePath.c_str(), ios_base::in | ios_base::binary);
push(gzip_decompressor());