From: Emilio Pozuelo Monfort Date: Thu, 22 Oct 2009 14:28:13 +0000 (+0200) Subject: Don't crash if the sqlite database lacks some values X-Git-Tag: LIBSOUP_2_29_3~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1866a401a37270a441e5661c87e32323fa2d7aa2;p=platform%2Fupstream%2Flibsoup.git Don't crash if the sqlite database lacks some values Right now we strcmp() the isSecure and isHttpOnly values, but if they are missing we will crash since strcmp() is not NULL safe. Use g_strcmp0() instead. --- diff --git a/libsoup/soup-cookie-jar-sqlite.c b/libsoup/soup-cookie-jar-sqlite.c index f782cb3..8114f17 100644 --- a/libsoup/soup-cookie-jar-sqlite.c +++ b/libsoup/soup-cookie-jar-sqlite.c @@ -207,8 +207,8 @@ callback (void *data, int argc, char **argv, char **colname) if (max_age <= 0) return 0; - http_only = (strcmp (argv[COL_HTTP_ONLY], "1") == 0); - secure = (strcmp (argv[COL_SECURE], "1") == 0); + http_only = (g_strcmp0 (argv[COL_HTTP_ONLY], "1") == 0); + secure = (g_strcmp0 (argv[COL_SECURE], "1") == 0); cookie = soup_cookie_new (name, value, host, path, max_age);