commit 39ef6f5afebdf80790cce791770fc489fb495ea9
Author: Christophe Fergeau <[email protected]>
Date:   Thu Dec 10 21:26:06 2009 +0100

    handle UTF-16 conversion errors from iTunesDB
    
    Before this commit, libgpod was blindly passing the return value of
    g_utf16_to_utf8 to g_utf8_validate. If the conversion fails, the returned
    string will be NULL and g_utf8_validate will crash. This patch makes
    sure we don't call g_utf8_validate with a NULL string

 src/itdb_itunesdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 52b62d2..b80b462 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -1324,7 +1324,7 @@ static char *extract_mhod_string (FContents *cts, glong 
seek)
        }
     }
 
-    if (g_utf8_validate (entry_utf8, -1, NULL)) {
+    if ((entry_utf8 != NULL) && g_utf8_validate (entry_utf8, -1, NULL)) {
        return entry_utf8;
     } else {
        g_free (entry_utf8);

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to