Add NULL check for dhcp_server before dereferencing 80/259680/1
authorNishant Chaprana <n.chaprana@samsung.com>
Fri, 11 Jun 2021 04:22:07 +0000 (09:52 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Fri, 11 Jun 2021 04:22:07 +0000 (09:52 +0530)
Change-Id: I165545377844140c644e2112a34d64032844e008
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
src/wifi_ap.c

index 75f1da7..9a765a1 100755 (executable)
@@ -1254,7 +1254,8 @@ EXPORT_API int wifi_manager_ap_get_dhcp_server_address(wifi_manager_ap_h ap,
 
        if (_wifi_check_ap_validity(ap) == false ||
            (address_family != WIFI_MANAGER_ADDRESS_FAMILY_IPV4 &&
-            address_family != WIFI_MANAGER_ADDRESS_FAMILY_IPV6)) {
+            address_family != WIFI_MANAGER_ADDRESS_FAMILY_IPV6) ||
+           dhcp_server == NULL) {
                WIFI_LOG(WIFI_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
                __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
                return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE