[Geoserver-devel] [JIRA] (GEOS-7806) JDBCRoleService may cause NPE for roles without properties

Alessio Fabiani created an issue

GeoServer / BugGEOS-7806

JDBCRoleService may cause NPE for roles without properties

Issue Type:

BugBug

Assignee:

Alessio Fabiani

Components:

Security

Created:

21/Oct/16 1:00 PM

Priority:

HighHigh

Reporter:

Alessio Fabiani

The following method throws NPE if “propName” is NULL

public GeoServerRole getRoleByName(String role)
throws IOException {

while (rs2.next()) {
String propName = rs2.getString(1);
Object propValue = rs2.getObject(2);
roleObject.getProperties().put(propName, propValue==null ? “” : propValue );

This happens if a service returns roles without properties.

We should add a check on “propName != null”

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.456.2#100016-sha1:c34488c)

Atlassian logo