[grilo-plugins] youtube: Fix potential crasher
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] youtube: Fix potential crasher
- Date: Mon, 20 Jan 2014 09:22:09 +0000 (UTC)
commit 5ebf2ac1cbdfd261d9ad93193a4608c0d844d6b9
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jan 6 17:20:59 2014 +0100
youtube: Fix potential crasher
ytsrc might be uninitialised, so abort early in that case when called
from read_url_async().
https://bugzilla.gnome.org/show_bug.cgi?id=721642
src/youtube/grl-youtube.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/youtube/grl-youtube.c b/src/youtube/grl-youtube.c
index f0304f9..254d6a0 100644
--- a/src/youtube/grl-youtube.c
+++ b/src/youtube/grl-youtube.c
@@ -480,6 +480,8 @@ get_wc (void)
{
if (ytsrc && !ytsrc->priv->wc)
ytsrc->priv->wc = grl_net_wc_new ();
+ else if (!ytsrc)
+ return NULL;
return ytsrc->priv->wc;
}
@@ -518,6 +520,11 @@ read_url_async (const gchar *url,
gpointer user_data)
{
AsyncReadCb *arc;
+ GrlNetWc *wc;
+
+ wc = get_wc ();
+ if (!wc)
+ return;
arc = g_slice_new0 (AsyncReadCb);
arc->url = g_strdup (url);
@@ -525,7 +532,7 @@ read_url_async (const gchar *url,
arc->user_data = user_data;
GRL_DEBUG ("Opening async '%s'", url);
- grl_net_wc_request_async (get_wc (),
+ grl_net_wc_request_async (wc,
url,
cancellable,
read_done_cb,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]