return -EINVAL;
}
+ if (!name)
+ return -EINVAL;
+
if (_hal_api_conf_init())
return -EINVAL;
}
len_library_name = strlen(library_name);
- if (!name || (len_library_name + 1 > size) || len_library_name == 0) {
+ if ((len_library_name + 1 > size) || len_library_name == 0) {
ret = -EINVAL;
- name = NULL;
goto out;
}
strncpy(name, library_name, size);
return -EINVAL;
}
+ if (!name)
+ return -EINVAL;
+
if (_hal_api_conf_init())
return -EINVAL;
*abi_version = info->backend->abi_version;
/* Return name of hal_backend structure */
- } else if (info->backend->name && name_size && !vendor_size) {
+ } else if (info->backend->name && name && name_size && !vendor_size) {
len = strlen(info->backend->name);
if (!info->backend->name || (len + 1 > name_size)) {
strncpy(name, info->backend->name, name_size);
/* Return vendor of hal_backend structure */
- } else if (info->backend->vendor && !name_size && vendor_size) {
+ } else if (info->backend->vendor && vendor && !name_size && vendor_size) {
len = strlen(info->backend->vendor);
if (!info->backend->vendor || (len + 1 > vendor_size)) {
if (lib_count == 0)
count++;
else if (lib_count > 0) {
+ if (!lib_names[count])
+ goto err_uninitialized_buffer;
strncpy(lib_names[count], de->d_name, lib_name_size);
count++;
}
return count;
+err_uninitialized_buffer:
err_mismatch_count:
for (i = count - 1; i >= 0; i--)
memset(lib_names[i], 0, strlen(lib_names[i]));