[Xfce4-commits] <midori:master> Use sqlite3_mprintf to quote when inserting bookmark items

Christian Dywan noreply at xfce.org
Mon Jul 12 00:08:01 CEST 2010


Updating branch refs/heads/master
         to 5a082100c80af824bd5b8880b86e7d82e74b50be (commit)
       from df1f754a562c2fa4e6126ca6d01b826622be9e64 (commit)

commit 5a082100c80af824bd5b8880b86e7d82e74b50be
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Jul 11 23:49:13 2010 +0200

    Use sqlite3_mprintf to quote when inserting bookmark items

 panels/midori-bookmarks.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c
index 5450f0b..d767bec 100644
--- a/panels/midori-bookmarks.c
+++ b/panels/midori-bookmarks.c
@@ -232,12 +232,9 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
     else
         parent = g_strdup ("");
 
-    /* Workaround a sqlite3_mprintf error with
-       handling of katze_item_get_meta_integer(). */
-    /* FIXME: Need proper single quote escaping. */
-    sqlcmd = g_strdup_printf (
+    sqlcmd = sqlite3_mprintf (
             "INSERT into bookmarks (uri, title, folder, toolbar, app) values"
-            " ('%s', '%s', '%s', %d, %d)",
+            " ('%q', '%q', '%q', %d, %d)",
             uri,
             katze_item_get_name (item),
             parent,
@@ -252,7 +249,7 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
 
     g_free (uri);
     g_free (parent);
-    g_free (sqlcmd);
+    sqlite3_free (sqlcmd);
 }
 
 void



More information about the Xfce4-commits mailing list