After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674319 - gupnp_didl_lite_contributor_get_name crashes when invoked on a contributor that contains an empty artist tag
gupnp_didl_lite_contributor_get_name crashes when invoked on a contributor th...
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
unspecified
Other Linux
: Normal critical
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-18 11:45 UTC by Mark Ryan
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix crash in gupnp_didl_lite_contributor_get_name (1.32 KB, patch)
2012-04-18 11:45 UTC, Mark Ryan
committed Details | Review
Add regression test for bgo#674319 (4.79 KB, patch)
2012-04-20 11:05 UTC, Jens Georg
none Details | Review
Add regression test for bgo#674319 (4.69 KB, patch)
2012-04-20 11:07 UTC, Jens Georg
committed Details | Review

Description Mark Ryan 2012-04-18 11:45:24 UTC
Created attachment 212278 [details] [review]
Patch to fix crash in gupnp_didl_lite_contributor_get_name

The crash occurs if the DIDL used to create the contributor contains an empty artist tag, e.g., <upnp:artist></upnp:artist>.  A call to gupnp_didl_lite_object_get_artists results in a list of one element.  Unfortunately, invoking gupnp_didl_lite_contributor_get_name on this element causes a crash.

Please find attached a patch that addresses this problem. 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.

The patch consider empty artists tags to be useless and it ignores them.  It does this even if they contain a role.  This behaviour is consistent with the deprecated gupnp_didl_lite_object_get_artist function that I believe will return NULL if the DIDL contains an empty artist tag, implying that an artist has not been specified.

An alternative would be to modify gupnp_didl_lite_contributor_get_name to return NULL or an empty string, if the artists tag is empty.  This would allow clients to retrieve the role attribute specified for an empty artist tag.  However, I'm not sure how useful this would be.
Comment 1 Jens Georg 2012-04-20 11:04:25 UTC
Review of attachment 212278 [details] [review]:

Looks good.
Comment 2 Jens Georg 2012-04-20 11:05:41 UTC
Created attachment 212413 [details] [review]
Add regression test for bgo#674319
Comment 3 Jens Georg 2012-04-20 11:07:49 UTC
Created attachment 212414 [details] [review]
Add regression test for bgo#674319

Adapt to new behaviour