From 1866a401a37270a441e5661c87e32323fa2d7aa2 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Thu, 22 Oct 2009 16:28:13 +0200 Subject: [PATCH] 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. --- libsoup/soup-cookie-jar-sqlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.7.4