handle = dlopen(filename, RTLD_NOW);
g_free(filename);
if (handle == NULL) {
- UAM_ERR("Can't load plugin %s: %s", filename, dlerror());
+ UAM_ERR("Can't load plugin%s", dlerror());
return UAM_ERROR_INTERNAL;
}
uam_sensor_plugin_info_t *plugin;
id = _pm_util_sensor_bitmask_to_plugin_id(sensor_bitmask);
- retv_if(UAS_PLUGIN_ID_MAX < id, FALSE);
+ retv_if(UAS_PLUGIN_ID_MAX <= id, FALSE);
plugin = plugins[id];
retv_if(!plugin || !plugin->api, FALSE);
for (l1 = tech->addresses; NULL != l1; l1 = g_slist_next(l1)) {
uam_db_address_info_t *addr = l1->data;
- if (!l1)
+ if (!addr)
continue;
switch (addr->addr_type) {
user = g_new0(uam_db_user_info_t, 1);
user->user_id = __uam_core_reserve_user_id();
- if (0 > user->user_id) {
+ if (USHRT_MAX - 1 < user->user_id) {
UAM_ERR("Max user limit reached");
g_free(user);
return UAM_ERROR_INTERNAL;
}
}
l = g_slist_find_custom(users, USER_ACCOUNT_DEFAULT, __compare_user_account);
- user = l->data;
+ if (l)
+ user = l->data;
+ else {
+ UAM_ERR("_uam_core_add_user failed because user is null");
+ return;
+ }
} else {
l = g_slist_find_custom(users, &user_id, __compare_user_id);
if (NULL == l) {
ret_if(NULL == req_info);
ret_if(NULL == req_info->sender);
- for (l = request_list; l != NULL; l = g_slist_next(l)) {
+ for (l = request_list; NULL != l; l = g_slist_next(l)) {
uam_request_context_t *info = l->data;
if (NULL == info || NULL == info->sender)
continue;