SessionSerializer crash when filename length is less than 3

pull/54/merge
Tatsuhiro Tsujikawa 2013-03-03 13:19:52 +09:00
parent 910e40f128
commit f4469b79aa
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ bool SessionSerializer::save(const std::string& filename) const
{
SharedHandle<BufferedFile> fp;
#if HAVE_ZLIB
if (filename.compare(filename.length() - 3, 3, ".gz") == 0) {
if (util::endsWith(filename, ".gz")) {
fp.reset(new GZipFile(tempFilename.c_str(), BufferedFile::WRITE));
}
else