Commit fe9fb186 authored by Ludovic Ferrandis's avatar Ludovic Ferrandis Committed by Jens Georg
Browse files

Fix a potential crash in case of a corrupted or malformed XML file.

In icon_parse() function, icon->mime_type could be initialized to NULL.
The call to strcmp could potentially crash.

https://bugzilla.gnome.org/show_bug.cgi?id=704094
parent 27e2dbec
...@@ -751,8 +751,9 @@ gupnp_device_info_get_icon_url (GUPnPDeviceInfo *info, ...@@ -751,8 +751,9 @@ gupnp_device_info_get_icon_url (GUPnPDeviceInfo *info,
icon = icon_parse (info, element); icon = icon_parse (info, element);
if (requested_mime_type) { if (requested_mime_type) {
mime_type_ok = if (icon->mime_type)
!strcmp (requested_mime_type, mime_type_ok = !strcmp (
requested_mime_type,
(char *) icon->mime_type); (char *) icon->mime_type);
} else } else
mime_type_ok = TRUE; mime_type_ok = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment