[tracker/experiment-with-roi] libtracker-extract: Don't assume ':' exists in every path we iterate
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/experiment-with-roi] libtracker-extract: Don't assume ':' exists in every path we iterate
- Date: Tue, 6 Sep 2011 16:36:37 +0000 (UTC)
commit 22b03b4fcb78c4c8d2ff3e73e8dbc037cbe1977a
Author: Martyn Russell <martyn lanedo com>
Date: Tue Sep 6 15:04:37 2011 +0100
libtracker-extract: Don't assume ':' exists in every path we iterate
This makes sure we don't accidentally return g_strdup(NULL + 1) when iterating
XMP data
src/libtracker-extract/tracker-xmp.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 99c353a..7fa5879 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -350,11 +350,16 @@ iterate_simple (const gchar *uri,
const gchar *p;
gchar *propname;
- name = g_strdup (strchr (path, ':') + 1);
+ p = strchr (path, ':');
+ if (!p) {
+ return;
+ }
- /* For 'dc:subject[1]' the name will be 'subject'.
- * This rule doesn't work for RegionLists
- */
+ name = g_strdup (p + 1);
+
+ /* For 'dc:subject[1]' the name will be 'subject'.
+ * This rule doesn't work for RegionLists
+ */
p = strrchr (name, '[');
if (p) {
name[p - name] = '\0';
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]