[tracker/rss-enclosures] TrackerDBInterfaceSqlite: do sanity check on is_parent() and is_descendant().
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] TrackerDBInterfaceSqlite: do sanity check on is_parent() and is_descendant().
- Date: Mon, 3 May 2010 00:42:59 +0000 (UTC)
commit 2614eaf7bf582fdd6ce93f51009d6deed66033cc
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Apr 22 13:35:21 2010 +0200
TrackerDBInterfaceSqlite: do sanity check on is_parent() and is_descendant().
src/libtracker-db/tracker-db-interface-sqlite.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index 95ee2d3..8f9f014 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -245,6 +245,14 @@ function_sparql_uri_is_parent (sqlite3_context *context,
return;
}
+ /* Check only one argument, it's going to
+ * be compared with the other anyway.
+ */
+ if (strstr (parent, "://") == NULL) {
+ sqlite3_result_int (context, FALSE);
+ return;
+ }
+
parent_len = strlen (parent);
/* Remove trailing '/', will
@@ -306,6 +314,14 @@ function_sparql_uri_is_descendant (sqlite3_context *context,
return;
}
+ /* Check only one argument, it's going to
+ * be compared with the other anyway.
+ */
+ if (strstr (parent, "://") == NULL) {
+ sqlite3_result_int (context, FALSE);
+ return;
+ }
+
parent_len = strlen (parent);
/* Remove trailing '/', will
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]