[libsoup] Don't crash if the sqlite database lacks some values
- From: Emilio Pozuelo Monfort <epm src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libsoup] Don't crash if the sqlite database lacks some values
- Date: Thu, 22 Oct 2009 14:44:20 +0000 (UTC)
commit 1866a401a37270a441e5661c87e32323fa2d7aa2
Author: Emilio Pozuelo Monfort <pochu27 gmail com>
Date: Thu Oct 22 16:28:13 2009 +0200
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 files 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]