[gupnp-av] Fixed a crash in gupnp_didl_lite_contributor_get_name



commit ad7fa6b33300393110f51851cb8e31b4c16b1c8d
Author: Mark Ryan <mark d ryan intel com>
Date:   Thu Apr 5 09:45:56 2012 +0200

    Fixed a crash in gupnp_didl_lite_contributor_get_name
    
    The crash occurs if the DIDL contains an empty artists tag, e.g.,
    <upnp:artist></upnp:artist>.  A call to gupnp_didl_lite_object_get_artists
    results in a list of one element.  However, invoking
    gupnp_didl_lite_contributor_get_name on this element causes a crash.
    The fix works by modifying get_contributor_list_by_name so that it does
    not add empty artists nodes to the list of contributors it creates.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674319

 libgupnp-av/gupnp-didl-lite-object.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index fc59da1..4482b58 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -797,6 +797,8 @@ get_contributor_list_by_name (GUPnPDIDLLiteObject *object,
                 xmlNode *contributor_node;
 
                 contributor_node = (xmlNode *) l->data;
+                if (!contributor_node->children)
+                        continue;
 
                 contributor = gupnp_didl_lite_contributor_new_from_xml
                                         (contributor_node,



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