After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596859 - don't rely on moz_cookies schema columns/order
don't rely on moz_cookies schema columns/order
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-09-30 11:48 UTC by Alexander Sack
Modified: 2009-10-02 07:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
explicity QUERY_ALL (726 bytes, patch)
2009-09-30 11:48 UTC, Alexander Sack
none Details | Review

Description Alexander Sack 2009-09-30 11:48:18 UTC
Created attachment 144384 [details] [review]
explicity QUERY_ALL

we received ephy webkit crashes like:

13:23 < seb128> ==7517== Invalid read of size 1
13:23 < seb128> ==7517==    at 0x569668F: callback
(soup-cookie-jar-sqlite.c:210)
13:23 < seb128> ==7517==    by 0x5FE5C27: sqlite3_exec (in
/usr/lib/libsqlite3.so.0.8.6)
13:23 < seb128> ==7517==    by 0x5696417: exec_query_with_try_create_table
(soup-cookie-jar-sqlite.c:246)

problem seems to be QUERY_ALL which just uses *

however, the schema is not guaranteed to have the same column order. for
instance we have those too schemas in the wild:

13:42 < xan-afk> CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT,
value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed 
                 INTEGER, isSecure INTEGER, isHttpOnly INTEGER);

vs.

13:39 < asac> xan-afk: .schema moz_cookies
13:39 < asac> CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT,
value TEXT, host TEXT, path TEXT,expiry INTEGER, isSecure INTEGER, 
              isHttpOnly INTEGER, lastAccessed INTEGER);


attaching patch to make QUERY_ALL explicit about the columns it wants and the
order.
Comment 1 Sebastien Bacher 2009-09-30 11:49:24 UTC
the patch fixes the crash there
Comment 2 Xan Lopez 2009-10-02 07:32:40 UTC
Pushed this to master, thanks!