[sound-juicer] Fix NULL string dereference
- From: Phillip Wood <pwood src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sound-juicer] Fix NULL string dereference
- Date: Fri, 5 Feb 2016 10:47:23 +0000 (UTC)
commit f2b03af59e67392fb48cb327b1834d76c5486c86
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 5987af9..e4004a6 100644
--- a/libjuicer/sj-metadata-musicbrainz5.c
+++ b/libjuicer/sj-metadata-musicbrainz5.c
@@ -893,9 +893,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]