Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCryptPasswordEncoder.encode() throws NPE #8317

Closed
alan-czajkowski opened this issue Apr 2, 2020 · 3 comments
Closed

BCryptPasswordEncoder.encode() throws NPE #8317

alan-czajkowski opened this issue Apr 2, 2020 · 3 comments
Assignees
Labels
in: core An issue in spring-security-core status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@alan-czajkowski
Copy link
Contributor

alan-czajkowski commented Apr 2, 2020

BCryptPasswordEncoder.encode() throws a Null Pointer Exception (NPE) when passing in a null rawPassword and then rawPassword.toString() is called inside the method.

This method can and should be made null-safe, either:

  • check for null and return null, or
  • throw some kind of exception
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 2, 2020
@rwinch
Copy link
Member

rwinch commented Apr 3, 2020

@alan-czajkowski We don't want to return null for the encoding, but I'd be open to returning an IllegalArgumentException. Would you be willing to submit a PR?

@rwinch rwinch added in: core An issue in spring-security-core status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 3, 2020
@alan-czajkowski
Copy link
Contributor Author

@rwinch I'll submit a PR

@alan-czajkowski
Copy link
Contributor Author

alan-czajkowski commented Apr 4, 2020

@rwinch done: #8330

alan-czajkowski added a commit to alan-czajkowski/spring-security that referenced this issue Apr 7, 2020
@rwinch rwinch closed this as completed in 4b2afdf Apr 7, 2020
@rwinch rwinch removed the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Apr 7, 2020
@rwinch rwinch self-assigned this Apr 7, 2020
@rwinch rwinch added this to the 5.4.0.M1 milestone Apr 7, 2020
rwinch pushed a commit that referenced this issue Apr 7, 2020
@spring-projects-issues spring-projects-issues added the status: backported An issue that has been backported to maintenance branches label Apr 7, 2020
rwinch pushed a commit that referenced this issue Apr 7, 2020
rwinch pushed a commit that referenced this issue Apr 7, 2020
rwinch pushed a commit that referenced this issue Apr 7, 2020
rwinch pushed a commit that referenced this issue Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants