[gnome-photos] item-manager: Handle untrusted cursors when looking for a collection
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] item-manager: Handle untrusted cursors when looking for a collection
- Date: Tue, 6 Feb 2018 23:20:16 +0000 (UTC)
commit 677ae108dd00d764b0393248a64ef9362101be49
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 6 23:58:59 2018 +0100
item-manager: Handle untrusted cursors when looking for a collection
A subsequent commit will use PHOTOS_QUERY_FLAGS_UNFILTERED to check
for URN changes caused by atomic file updates. This will lead to a
more relaxed query, so it's wise to watch out for a NULL RDF type.
src/photos-item-manager.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 629add94..1fab4770 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -186,11 +186,16 @@ photos_item_manager_can_add_item_for_mode (PhotosItemManager *self, PhotosBaseIt
static gboolean
photos_item_manager_cursor_is_collection (TrackerSparqlCursor *cursor)
{
- gboolean ret_val;
+ gboolean ret_val = FALSE;
const gchar *rdf_type;
rdf_type = tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_RDF_TYPE, NULL);
+ if (rdf_type == NULL)
+ goto out;
+
ret_val = strstr (rdf_type, "nfo#DataContainer") != NULL;
+
+ out:
return ret_val;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]