Fix NULL dereference issue 30/105230/1 accepted/tizen/common/20161219.151940 accepted/tizen/ivi/20161219.022200 accepted/tizen/mobile/20161219.022104 accepted/tizen/tv/20161219.022124 accepted/tizen/wearable/20161219.022145 submit/tizen/20161219.010347
authorWootak Jung <wootak.jung@samsung.com>
Fri, 16 Dec 2016 05:08:42 +0000 (14:08 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Fri, 16 Dec 2016 05:08:42 +0000 (14:08 +0900)
Change-Id: I1251f1ab6e7cadad3d1036d1a1859b0803b5d837

packaging/tel-plugin-packetservice.spec
src/ps_context.c
src/ps_main.c

index adc95bb..50f9a02 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 3
-%define patchlevel 35
+%define patchlevel 36
 
 Name:           tel-plugin-packetservice
 Version:        %{major}.%{minor}.%{patchlevel}
index bf859a5..e896109 100644 (file)
@@ -2433,7 +2433,7 @@ gboolean _ps_context_set_connected(gpointer object, gboolean enabled)
        gboolean b_roaming_checker = TRUE;
        gboolean data_allowed = FALSE;
        gboolean b_mms_checker = FALSE;
-       gboolean b_ims_checker = TRUE;
+       gboolean b_ims_checker = FALSE;
 
        enum co_context_role role = CONTEXT_ROLE_UNKNOWN;
 
@@ -2529,6 +2529,10 @@ gboolean _ps_context_set_connected(gpointer object, gboolean enabled)
                        g_free(context->remove_profile_cb_data);
                        context->remove_profile_cb_data = NULL;
 
+                       if (service == NULL) {
+                               err("service is NULL");
+                               goto EXIT;
+                       }
                        /* Remove context */
                        _ps_service_unref_context(service, context);
                        service->contexts = g_slist_remove(service->contexts, context);
index a163864..0dedd90 100644 (file)
@@ -154,7 +154,6 @@ gboolean ps_main_init(TcorePlugin *p)
                NULL,
                NULL,
                &error);
-       g_free(address);
        g_assert_no_error(error);
        if (!conn)
                err("Failure: G-dBus Connection failed"); /* TODO - Clean-up */
@@ -174,6 +173,7 @@ gboolean ps_main_init(TcorePlugin *p)
 
        info("PacketService - dBus address: [%s] dBus connection ID: [%d]",
                address, id);
+       g_free(address);
 
        /*
         * Initializing custom data for Packet Service