Added NULL pointer guard check before g_ascii_strcasecmp. 79/151479/1 accepted/tizen/4.0/unified/20170922.195444 submit/tizen_4.0/20170922.014023
authorAbhishek Chandra <abhishek.ch@samsung.com>
Wed, 20 Sep 2017 12:29:23 +0000 (17:59 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 21 Sep 2017 04:58:54 +0000 (13:58 +0900)
Change-Id: I04c475c9316ac04437d3ea0bc096e3da346ba421
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-common.c
bt-service/bt-service-network.c

index d3de84b..af738d5 100644 (file)
@@ -1485,9 +1485,12 @@ int _bt_discover_service_uuids(char *address, char *remote_uuid)
        if (uuid_value) {
                for (i = 0; uuid_value[i] != NULL; i++) {
                        BT_DBG("Remote uuids %s", uuid_value[i]);
-                       if (g_ascii_strcasecmp(uuid_value[i], remote_uuid) == 0) {
-                               result = BLUETOOTH_ERROR_NONE;
-                               goto done;
+                       if (uuid_value[i] == NULL) {
+                               BT_ERR("_bt_discover_service_uuids Error Parameter are NULL..\n");
+                               continue;
+                       } else if (g_ascii_strcasecmp(uuid_value[i], remote_uuid) == 0) {
+                                       result = BLUETOOTH_ERROR_NONE;
+                                       goto done;
                        }
                }
        }
index 00140da..bd065b2 100644 (file)
@@ -100,7 +100,10 @@ static connection_profile_h __bt_get_net_profile(void *connection,
                        if (g_strv_length(split_string) < 3)
                                continue;
 
-                       if (g_ascii_strcasecmp(split_string[2], net_address) == 0) {
+                       if (split_string[2] == NULL) {
+                               BT_ERR("__bt_get_net_profile Error Parameter are NULL..\n");
+                               continue;
+                       } else if (g_ascii_strcasecmp(split_string[2], net_address) == 0) {
                                BT_DBG("matched profile");
                                g_strfreev(split_string);
                                return profile_h;