extern "C" EXPORT_API int component_port_create(const char* port_name,
component_port_h* port) {
- if (port_name == nullptr || port == nullptr) {
+ if (port_name == nullptr || strlen(port_name) == 0 || port == nullptr) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int component_port_add_privilege(component_port_h port,
const char *privilege) {
- if (port == nullptr || privilege == nullptr) {
+ if (port == nullptr || privilege == nullptr || strlen(privilege) == 0) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int component_port_send(component_port_h port,
const char *endpoint, int timeout, parcel_h request) {
- if (port == nullptr || endpoint == nullptr || request == nullptr) {
+ if (port == nullptr || endpoint == nullptr || request == nullptr ||
+ strlen(endpoint) == 0) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int component_port_send_sync(component_port_h port,
const char *endpoint, int timeout, parcel_h request, parcel_h *response) {
if (port == nullptr || endpoint == nullptr || request == nullptr ||
- response == nullptr) {
+ response == nullptr || strlen(endpoint) == 0) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int component_port_is_running(const char* endpoint,
bool* is_running) {
- if (endpoint == nullptr || is_running == nullptr) {
+ if (endpoint == nullptr || is_running == nullptr || strlen(endpoint) == 0) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}
void* user_data,
unsigned int* watcher_id) {
if (endpoint == nullptr || appeared_cb == nullptr || vanished_cb == nullptr ||
- watcher_id == nullptr) {
+ watcher_id == nullptr || strlen(endpoint) == 0) {
_E("Invalid parameter");
return COMPONENT_PORT_ERROR_INVALID_PARAMETER;
}