[gupnp] Fix potential crashes in case of a bad parameter.



commit ee0745fe14ad4a7bae60db8dfcc95a79b98e3b90
Author: Ludovic Ferrandis <ludovic ferrandis intel com>
Date:   Thu Jul 11 10:54:43 2013 +0200

    Fix potential crashes in case of a bad parameter.
    
    In both function, if type parameter is NULL, the call to
    resource_type_match will crash as this function call strcmp on type
    without any check.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704094

 libgupnp/gupnp-device-info.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-device-info.c b/libgupnp/gupnp-device-info.c
index afdc6ce..51f3871 100644
--- a/libgupnp/gupnp-device-info.c
+++ b/libgupnp/gupnp-device-info.c
@@ -1117,6 +1117,7 @@ gupnp_device_info_get_device (GUPnPDeviceInfo *info,
         xmlNode *element;
 
         g_return_val_if_fail (GUPNP_IS_DEVICE_INFO (info), NULL);
+        g_return_val_if_fail (type != NULL, NULL);
 
         class = GUPNP_DEVICE_INFO_GET_CLASS (info);
 
@@ -1271,6 +1272,7 @@ gupnp_device_info_get_service (GUPnPDeviceInfo *info,
         xmlNode *element;
 
         g_return_val_if_fail (GUPNP_IS_DEVICE_INFO (info), NULL);
+        g_return_val_if_fail (type != NULL, NULL);
 
         class = GUPNP_DEVICE_INFO_GET_CLASS (info);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]