Fix the svace issue 11/135411/1
authorInjun Yang <injun.yang@samsung.com>
Tue, 20 Jun 2017 01:44:04 +0000 (10:44 +0900)
committerInjun Yang <injun.yang@samsung.com>
Thu, 22 Jun 2017 07:47:18 +0000 (16:47 +0900)
Change-Id: I144d9f054ec097e17a089d70c34aca4d7e358c1f

src/device.c

index c808291..321218d 100644 (file)
@@ -4251,10 +4251,12 @@ static void load_info(struct btd_device *device, const char *local,
 
                str = g_key_file_get_string(key_file, "General", "ManufacturerData", NULL);
                if (str) {
-                       load_manufacturer_data_2digit(str,
-                                               device->manufacturer_data_len,  buf);
-                       device->manufacturer_data = g_memdup(buf,
-                                               device->manufacturer_data_len);
+                       if (device->manufacturer_data_len < DEV_MAX_MANUFACTURER_DATA_LEN ) {
+                               load_manufacturer_data_2digit(str,
+                                                       device->manufacturer_data_len,  buf);
+                               device->manufacturer_data = g_memdup(buf,
+                                                       device->manufacturer_data_len);
+                       }
                        g_free(str);
                }
        }