summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtrunov <dtrunov@luxoft.com>2016-01-27 17:00:14 +0200
committerdtrunov <dtrunov@luxoft.com>2016-02-10 14:55:17 +0200
commit40fdc8fc9b98f9adf00effbea9a8e5e499842451 (patch)
tree0ada29233e323f4934ac3852ade2bdcd2f631d8f
parent081b9be9f3ccd5fa2c43931e7c9fb758f10e0994 (diff)
downloadsmartdevicelink-40fdc8fc9b98f9adf00effbea9a8e5e499842451.tar.gz
Check validity of pointer to application, posible fix for PASA core crash.
Closes-bug[APPLINK-20958](https://adc.luxoft.com/jira/browse/APPLINK-20958)
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 07324d5bc..42d855a81 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -1681,9 +1681,14 @@ void MessageHelper::GetDeviceInfoForApp(uint32_t connection_key,
return;
}
- device_info->device_handle =
- ApplicationManagerImpl::instance()->application(connection_key)->device();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ connection_key);
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application with connection_key " << connection_key);
+ return;
+ }
+ device_info->device_handle = app->device();
GetDeviceInfoForHandle(device_info->device_handle, device_info);
}