[WGID-84174] Add null checking code to prevent null pointer exception 01/79601/4 accepted/tizen/common/20160712.151315 accepted/tizen/mobile/20160712.091239 accepted/tizen/wearable/20160712.091217 submit/tizen/20160712.074045
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 12 Jul 2016 04:03:57 +0000 (13:03 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 12 Jul 2016 06:33:50 +0000 (15:33 +0900)
Change-Id: I47f07182d22c9b49813f17464d1700501a142b91
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/capi-network-softap.spec
src/softap.c

index d594b7d1b0b7faa2bbc46965c12da03e022dee39..ca8f082f074164f6d1b56a8fe96e714339be440e 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-softap
 Summary:       Softap Framework
-Version:       0.0.6
+Version:       0.0.7
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index d212eb504148392583d43cdd9b680660b6a42b21..18ddaee130caa98887e6284d6fcdbd83f39280d2 100755 (executable)
@@ -704,6 +704,8 @@ static bool __get_ssid_from_vconf(const char *path, char *ssid, unsigned int siz
 API int softap_create(softap_h *softap)
 {
        DBG("+");
+       _retvm_if(softap == NULL, SOFTAP_ERROR_INVALID_PARAMETER,
+                       "parameter(softap) is NULL\n");
 
        __softap_h *sa = NULL;
        GError *error = NULL;
@@ -755,7 +757,8 @@ API int softap_create(softap_h *softap)
                        NULL, SOFTAP_SERVICE_NAME, SOFTAP_SERVICE_OBJECT_PATH,
                        SOFTAP_SERVICE_INTERFACE, sa->cancellable, &error);
        if (!sa->client_bus_proxy) {
-               ERR("Fail to create the proxy object because of %s", error->message);
+               if (error)
+                       ERR("Fail to create the proxy object because of %s", error->message);
                g_cancellable_cancel(sa->cancellable);
                g_object_unref(sa->cancellable);
                free(sa);
@@ -894,6 +897,8 @@ API int softap_is_enabled(softap_h softap, bool *enable)
        DBG("+");
        _retvm_if(softap == NULL, SOFTAP_ERROR_INVALID_PARAMETER,
                        "parameter(softap) is NULL");
+       _retvm_if(enable == NULL, SOFTAP_ERROR_INVALID_PARAMETER,
+                       "parameter(enable) is NULL");
 
        int is_on = 0;
        int vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI_AP;