mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +03:00
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:
parent
20344c0008
commit
bf3caff97e
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user