Make QUERY_ALL explicit in SoupCookieJarSQLite
authorAlexander Sack <asac@ubuntu.com>
Fri, 2 Oct 2009 07:28:59 +0000 (10:28 +0300)
committerXan Lopez <xan@gnome.org>
Fri, 2 Oct 2009 07:28:59 +0000 (10:28 +0300)
SELECT * is dangerous, as there seems to be at least two different
formats with different orders in the wild.

Bug #596859

Signed-off-by: Xan Lopez <xan@gnome.org>
libsoup/soup-cookie-jar-sqlite.c

index b7bb579..f782cb3 100644 (file)
@@ -168,7 +168,7 @@ soup_cookie_jar_sqlite_new (const char *filename, gboolean read_only)
                             NULL);
 }
 
-#define QUERY_ALL "SELECT * FROM moz_cookies;"
+#define QUERY_ALL "SELECT id, name, value, host, path, expiry, lastAccessed, isSecure, isHttpOnly FROM moz_cookies;"
 #define CREATE_TABLE "CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER)"
 #define QUERY_INSERT "INSERT INTO moz_cookies VALUES(NULL, %Q, %Q, %Q, %Q, %d, NULL, %d, %d);"
 #define QUERY_DELETE "DELETE FROM moz_cookies WHERE name=%Q AND host=%Q;"