Browse Source

Compare 16bytes of header text.

Tatsuhiro Tsujikawa 14 years ago
parent
commit
f6472abae8
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/CookieStorage.cc

+ 1 - 2
src/CookieStorage.cc

@@ -348,8 +348,7 @@ bool CookieStorage::load(const std::string& filename, time_t now)
     headlen = fp.read(header, sizeof(header));
   }
   try {
-    if(headlen &&
-       std::string(&header[0], &header[headlen-1]) == "SQLite format 3") {
+    if(headlen == 16 && memcmp(header, "SQLite format 3\0", 16) == 0) {
 #ifdef HAVE_SQLITE3
       std::vector<Cookie> cookies;
       try {