Skip to content

This could be a bug that no check null in AuthorityUtils.java. #6773

Closed
@JokerSun

Description

@JokerSun

I guess there is a bug in org.springframework.security.core.authority.AuthorityUtils.java

public static Set<String> authorityListToSet(
		Collection<? extends GrantedAuthority> userAuthorities) {

/* No test parameters  userAuthorities, it may be null and led to NullPointException */

		Set<String> set = new HashSet<>(userAuthorities.size());
		for (GrantedAuthority authority : userAuthorities) {
		set.add(authority.getAuthority());
	}
	return set;
}

Metadata

Metadata

Assignees

Labels

in: coreAn issue in spring-security-coretype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions