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

Possible null pointer dereference of conn in com.shashi.service.impl.UserServiceImpl.registerUser(UserBean) #39

Open
gandhi-samir opened this issue Apr 8, 2024 · 0 comments

Comments

@gandhi-samir
Copy link

Describe the bug
There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Line 46 in UserServiceImpl.java

Found through FindBUgs, white box static code testing. ps = conn.prepareStatement("insert into " + IUserConstants.TABLE_USER + " values(?,?,?,?,?,?)");

if Conn is null this could cause issues. there is line 40 which checks if conn is null but this should also be used for the insert statement on line 46

if (conn != null) {....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant