[tracker-miners] libtracker-extract: Guarantee that titles are UTF-8



commit 5209d6737752200f97102459fe77b04e56de3e69
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Sep 26 15:45:49 2018 +0200

    libtracker-extract: Guarantee that titles are UTF-8
    
    The tracker_guarantee_resource_title_from_file() function may
    possibly accept non-utf8 from extractors. While the file display
    name fallbacks are utf8 safe, the given string should be checked.

 src/libtracker-extract/tracker-guarantee.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-guarantee.c b/src/libtracker-extract/tracker-guarantee.c
index 63202f435..e544a0552 100644
--- a/src/libtracker-extract/tracker-guarantee.c
+++ b/src/libtracker-extract/tracker-guarantee.c
@@ -109,7 +109,7 @@ tracker_guarantee_resource_title_from_file (TrackerResource  *resource,
        g_return_val_if_fail (uri != NULL, FALSE);
 
        if (current_value && *current_value != '\0') {
-               tracker_resource_set_string (resource, key, current_value);
+               tracker_guarantee_resource_utf8_string (resource, key, current_value);
 
                if (p_new_value != NULL) {
                        *p_new_value = g_strdup (current_value);
@@ -133,7 +133,7 @@ tracker_guarantee_resource_title_from_file (TrackerResource  *resource,
        }
 #else  /* GUARANTEE_METADATA */
        if (current_value && *current_value != '\0') {
-               tracker_resource_set_string (resource, key, current_value);
+               tracker_guarantee_resource_utf8_string (resource, key, current_value);
 
                if (p_new_value != NULL) {
                        *p_new_value = g_strdup (current_value);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]