[sound-juicer/gnome-3-18: 1/2] Fix NULL string dereference



commit 0e19e7015eb34ab1ab3e8060f8d1898cfe658f0f
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Wed Nov 4 14:52:17 2015 +0000

    Fix NULL string dereference
    
    Check that album->type is non-NULL before passing it to
    g_str_has_suffix(). This fixes warnings from g_str_has_suffix().

 libjuicer/sj-metadata-musicbrainz5.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libjuicer/sj-metadata-musicbrainz5.c b/libjuicer/sj-metadata-musicbrainz5.c
index 126e01c..d1f4e19 100644
--- a/libjuicer/sj-metadata-musicbrainz5.c
+++ b/libjuicer/sj-metadata-musicbrainz5.c
@@ -892,9 +892,9 @@ make_album_from_release (SjMetadataMusicbrainz5  *self,
   album->country = sj_metadata_helper_lookup_country_code (buffer);
   if (group) {
     GET (album->type, mb5_releasegroup_get_primarytype, group);
-    if (g_str_has_suffix (album->type, "Spokenword")
-        || g_str_has_suffix (album->type, "Interview")
-        || g_str_has_suffix (album->type, "Audiobook")) {
+    if (album->type != NULL && (g_str_has_suffix (album->type, "Spokenword")
+                                || g_str_has_suffix (album->type, "Interview")
+                                || g_str_has_suffix (album->type, "Audiobook"))) {
       album->is_spoken_word = TRUE;
     }
     relationlists = mb5_releasegroup_get_relationlistlist (group);


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