[PATCH 1/1] [shoutcast] Solved problem with null nodeTab



I found this problem when testing things for fremantle, but it seems
that in shoutcast case, we can have some radios providing a null nodeTab
and makes that code crash.

I could reproduce it by:
     1. Opening shoutcast
     2. Choosing 90s
     3. Select "FM Plus Chile - Antofagasta..."
     4. Select "MUTERADIO.COM.AR - Pop & Electronica - Buenos Aires -
        Argentina"
     5. Goto 3

After some iterations you get the crash. This happens immediately in the
N900.

What I don't know is if this happens in the other plugins too. There are
some with the same code scheme, but I am not sure if this depends on the
xml itself and it would not happen in the other plugins. Anyway, let's
keep an eye on this and if it happens with other plugins, let's take a
look at this first :)

Br.

-- 
Xabier Rodríguez Calvar
Enxeñeiro en Informática
IGALIA http://www.igalia.com
From 4c7c1bfea8a1816479fe4d10bc35baa8803b33e1 Mon Sep 17 00:00:00 2001
From: Xabier Rodriguez Calvar <xrcalvar igalia com>
Date: Mon, 7 Jun 2010 18:26:53 +0200
Subject: [PATCH] [shoutcast] Solved problem with null nodeTab

---
 src/shoutcast/grl-shoutcast.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/shoutcast/grl-shoutcast.c b/src/shoutcast/grl-shoutcast.c
index a373e86..a33276e 100644
--- a/src/shoutcast/grl-shoutcast.c
+++ b/src/shoutcast/grl-shoutcast.c
@@ -375,7 +375,8 @@ xml_parse_result (const gchar *str, OperationData *op_data)
                                           xpath_ctx);
       g_free (xpath_expression);
 
-      if (xpath_res && xpath_res->nodesetval->nodeTab[0]) {
+      if (xpath_res && xpath_res->nodesetval->nodeTab &&
+          xpath_res->nodesetval->nodeTab[0]) {
         op_data->xml_entries = xpath_res->nodesetval->nodeTab[0];
         if (stationlist_result) {
           build_media_from_station (op_data);
-- 
1.7.1

Attachment: signature.asc
Description: Esta =?ISO-8859-1?Q?=E9?= unha parte de mensaxe asinada dixitalmente



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