BugID:17291083:fix device secret NULL copy issue when create subdev
@@ -246,7 +246,9 @@ int dm_mgr_device_create(_IN_ int dev_type, _IN_ char product_key[PRODUCT_KEY_MA
node->dev_shadow = NULL;
memcpy(node->product_key, product_key, strlen(product_key));
memcpy(node->device_name, device_name, strlen(device_name));
+ if (device_secret != NULL) {
memcpy(node->device_secret, device_secret, strlen(device_secret));
+ }
node->dev_status = IOTX_DM_DEV_STATUS_AUTHORIZED;
node->tsl_source = IOTX_DM_TSL_SOURCE_CLOUD;
INIT_LIST_HEAD(&node->linked_list);
