[ssdp] Add error check 34/121534/2 accepted/tizen/common/20170403.190032 accepted/tizen/ivi/20170403.124600 accepted/tizen/mobile/20170403.124314 accepted/tizen/tv/20170403.124419 accepted/tizen/unified/20170403.124617 accepted/tizen/wearable/20170403.124447 submit/tizen/20170403.015738
authorchleun.moon <chleun.moon@samsung.com>
Tue, 28 Mar 2017 07:22:32 +0000 (16:22 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Tue, 28 Mar 2017 07:25:17 +0000 (16:25 +0900)
Check if the target is NULL in ssdp_create_local_service().
SSDP_ERROR_INVALID_PARAMETER is returned when NULL is passed as target

Change-Id: Ibcc9cf094c6935e056961f62556cff16f3105879
Signed-off-by: cheoleun <chleun.moon@samsung.com>
src/ssdp/ssdp.c

index 06ffd70..ca92dfc 100644 (file)
@@ -457,8 +457,14 @@ int ssdp_create_local_service(const char *target, ssdp_service_h *ssdp_service)
                return SSDP_ERROR_NOT_INITIALIZED;      //LCOV_EXCL_LINE
        }
 
+       if (target == NULL) {
+               SSDP_LOGE("target is NULL");
+               __SSDP_LOG_FUNC_EXIT__;
+               return SSDP_ERROR_INVALID_PARAMETER;
+       }
+
        if (ssdp_service == NULL) {
-               SSDP_LOGE("Invalid parameter");
+               SSDP_LOGE("ssdp_service is NULL");
                __SSDP_LOG_FUNC_EXIT__;
                return SSDP_ERROR_INVALID_PARAMETER;
        }