Fix to dereference and uncheck high bound 87/88587/1 accepted/tizen/common/20160921.161559 accepted/tizen/ivi/20160922.041627 accepted/tizen/mobile/20160922.041545 accepted/tizen/tv/20160922.041616 accepted/tizen/wearable/20160922.041604 submit/tizen/20160921.010208
authorTaejin Woo <tt.woo@samsung.com>
Tue, 20 Sep 2016 01:50:08 +0000 (10:50 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Tue, 20 Sep 2016 01:52:50 +0000 (10:52 +0900)
Change-Id: Ica56c80e6729d23a0cbb9a260ddf1dee56e13a31
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
bt-api/bt-gatt-client.c
bt-api/bt-gatt-service.c
bt-service/bt-service-adapter-le.c
bt-service/bt-service-obex-agent.c

index e9ec5e4..175d2be 100644 (file)
@@ -174,6 +174,12 @@ BT_EXPORT_API int bluetooth_gatt_set_service_change_watcher(
                }
                addr = g_malloc0(sizeof(bluetooth_device_address_t));
                memcpy(addr, address, sizeof(bluetooth_device_address_t));
+
+               if (service_monitor_list == NULL) {
+                       BT_ERR("There is NO watcher");
+                       return BLUETOOTH_ERROR_NONE;
+               }
+
                service_monitor_list =
                        g_slist_append(service_monitor_list, addr);
        } else {
index 66c0632..20bffd8 100644 (file)
@@ -299,7 +299,7 @@ static void __bt_gatt_manager_method_call(GDBusConnection *connection,
                                        GDBusMethodInvocation *invocation,
                                        gpointer user_data)
 {
-       GSList *l1;
+       GSList *l1 = NULL;
        int len = 0;
        int i = 0;
 
index 43e8cf5..eddbd36 100644 (file)
@@ -41,6 +41,7 @@
 #define BT_ADV_FILTER_POLICY_DEFAULT   0x00
 #define BT_ADV_TYPE_DEFAULT    0x00
 #define BT_ADV_FILTER_POLICY_ALLOW_SCAN_CONN_WL_ONLY   0x03
+#define BT_ADV_MULTI_MAX   16
 
 typedef struct {
        int adv_inst_max;
@@ -197,6 +198,7 @@ gboolean _bt_update_le_feature_support(const char *item, const char *value)
 
                slot_num = atoi(value);
                retv_if(slot_num < 0, FALSE);
+               retv_if(slot_num > BT_ADV_MULTI_MAX, FALSE);
 
                if (slot_num != le_feature_info.adv_inst_max) {
                        __bt_free_le_adv_slot();
index 4cc2b2f..b88d987 100644 (file)
@@ -450,7 +450,7 @@ gboolean _bt_obex_setup(const char *path)
 {
        bt_obex_agent_info *info;
        GDBusProxy *proxy;
-       GDBusNodeInfo *new_conn_node;
+       GDBusNodeInfo *new_conn_node = NULL;
        GDBusNodeInfo *auth_reply_node = NULL;
        GError *err = NULL;