Skip to content

Commit db353f1

Browse files
authored
Validate project ID in findProjectRoles method
1 parent f1e0864 commit db353f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/src/main/java/org/apache/cloudstack/acl/ProjectRoleManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public ProjectRole findProjectRole(Long roleId, Long projectId) {
168168

169169
@Override
170170
public List<ProjectRole> findProjectRoles(Long projectId, String keyword) {
171-
if (projectId == null) {
171+
if (projectId == null || projectId < 1L || projectDao.findById(projectId) == null) {
172172
logger.warn("Invalid project ID provided; thus, an empty list is being returned.");
173173
return Collections.emptyList();
174174
}

0 commit comments

Comments
 (0)