Commit 2aaf8825 authored by Bastien Nocera's avatar Bastien Nocera

podcasts: Fix crash trying to parse unsupported format

1. Add an Atom feed to the Podcasts plugin
2. Try to browse that Atom feed
3. RSS parser crashes as it doesn't know how to parse Atom

==8560== Invalid read of size 8
==8560==    at 0x1BBD36DF: parse_feed (grl-podcasts.c:1274)
==8560==    by 0x1BBD36DF: read_feed_cb (grl-podcasts.c:1365)
==8560==    by 0x1BBD1272: read_done_cb (grl-podcasts.c:494)
==8560==    by 0x52F1A69: g_simple_async_result_complete (in /usr/lib64/libgio-2.0.so.0.5800.3)
==8560==    by 0x1BB48D2F: read_async_cb (grl-net-wc.c:619)
==8560==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
parent e71a8a1f
Pipeline #58392 passed with stage
in 3 minutes and 12 seconds
...@@ -1269,6 +1269,13 @@ parse_feed (OperationSpec *os, const gchar *str, GError **error) ...@@ -1269,6 +1269,13 @@ parse_feed (OperationSpec *os, const gchar *str, GError **error)
xmlXPathFreeObject (xpathObj); xmlXPathFreeObject (xpathObj);
xpathObj = NULL; xpathObj = NULL;
if(podcast_data == NULL) {
*error = g_error_new_literal (GRL_CORE_ERROR,
os->error_code,
_("Failed to parse podcast contents"));
goto free_resources;
}
/* Check podcast pubDate (if available), if it has not been updated /* Check podcast pubDate (if available), if it has not been updated
recently then we can use the cache and avoid parsing the feed */ recently then we can use the cache and avoid parsing the feed */
if (podcast_data->published != NULL) { if (podcast_data->published != NULL) {
......
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