diff --git a/ChangeLog b/ChangeLog index 56aa2de6..07f18304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-22 Tatsuhiro Tsujikawa + + Check stream status after file is opened. + * src/CookieStorage.cc + 2009-07-22 Tatsuhiro Tsujikawa Rewritten Signature::save() diff --git a/src/CookieStorage.cc b/src/CookieStorage.cc index c81d9336..e716bd85 100644 --- a/src/CookieStorage.cc +++ b/src/CookieStorage.cc @@ -146,6 +146,10 @@ bool CookieStorage::load(const std::string& filename) { char header[16]; // "SQLite format 3" plus \0 std::ifstream s(filename.c_str(), std::ios::binary); + if(!s) { + _logger->error("Failed to open cookie file %s", filename.c_str()); + return false; + } s.get(header, sizeof(header)); if(!s) { _logger->error("Failed to read header of cookie file %s",