summaryrefslogtreecommitdiff
path: root/libdleyna/renderer/device.c
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-04-09 15:43:09 +0200
committerMark Ryan <mark.d.ryan@intel.com>2013-04-10 13:03:03 +0200
commite4a3e75550ce9f72a7ff6b3946e195d239ec873f (patch)
tree450627998be606b10bf3376d86ad24fd42206f7a /libdleyna/renderer/device.c
parente5dea5f6d883da1e09faab18be95ca64e10d6d0d (diff)
downloaddleyna-renderer-e4a3e75550ce9f72a7ff6b3946e195d239ec873f.tar.gz
[GUPnP] Output string parameter not initialized on success.
Fix https://github.com/01org/dleyna-renderer/issues/51 Check output string parameters before use, even if the command succeed. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna/renderer/device.c')
-rw-r--r--libdleyna/renderer/device.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libdleyna/renderer/device.c b/libdleyna/renderer/device.c
index 8c44cff..2cd0acc 100644
--- a/libdleyna/renderer/device.c
+++ b/libdleyna/renderer/device.c
@@ -647,13 +647,15 @@ static void prv_get_protocol_info_cb(GUPnPServiceProxy *proxy,
gpointer user_data)
{
gchar *result = NULL;
+ gboolean end;
GError *error = NULL;
prv_new_device_ct_t *priv_t = (prv_new_device_ct_t *)user_data;
DLEYNA_LOG_DEBUG("Enter");
- if (!gupnp_service_proxy_end_action(proxy, action, &error, "Sink",
- G_TYPE_STRING, &result, NULL)) {
+ end = gupnp_service_proxy_end_action(proxy, action, &error, "Sink",
+ G_TYPE_STRING, &result, NULL);
+ if (!end || (result == NULL)) {
DLEYNA_LOG_WARNING("GetProtocolInfo operation failed: %s",
error->message);
goto on_error;
@@ -1556,16 +1558,17 @@ static void prv_get_position_info_cb(GUPnPServiceProxy *proxy,
gpointer user_data)
{
gchar *rel_pos = NULL;
+ gboolean end;
dlr_async_task_t *cb_data = user_data;
GError *upnp_error = NULL;
dlr_device_data_t *device_data = cb_data->private;
GVariantBuilder *changed_props_vb;
GVariant *changed_props;
- if (!gupnp_service_proxy_end_action(cb_data->proxy, cb_data->action,
- &upnp_error,
- "RelTime",
- G_TYPE_STRING, &rel_pos, NULL)) {
+ end = gupnp_service_proxy_end_action(cb_data->proxy, cb_data->action,
+ &upnp_error, "RelTime",
+ G_TYPE_STRING, &rel_pos, NULL);
+ if (!end || (rel_pos == NULL)) {
cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
DLEYNA_ERROR_OPERATION_FAILED,
"GetPositionInfo operation failed: %s",