Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-7806

JDBCRoleService may cause NPE for roles without properties

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.3, 2.10.1, 2.11-beta
    • Component/s: Security
    • Labels:
      None

      Description

      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"

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                afabiani Alessio Fabiani
                Reporter:
                afabiani Alessio Fabiani
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: