-
Bug
-
Resolution: Done
-
Major
-
7.1.0.DR12
Coverity found 2 possible occurences of dereferencing null. Method propertyAliasFromOperation(final ModelNode operation) can return null.
And return value of propertyAliasFromOperation(final ModelNode operation) is dereferenced in transformOperationAddress(final ModelNode operation) and sameAlias(final OperationContext context, final ModelNode operation)
private static void transformOperationAddress(final ModelNode operation) { Property alias = propertyAliasFromOperation(operation); String newAlias = alias.getValue().asString().toLowerCase(Locale.ROOT); alias.getValue().set(newAlias); } private static boolean sameAlias(final OperationContext context, final ModelNode operation) { String contextAlias = context.getCurrentAddress().getLastElement().getValue(); String operationAlias = propertyAliasFromOperation(operation).getValue().asString(); return operationAlias.equals(contextAlias); } private static Property propertyAliasFromOperation(final ModelNode operation) { ModelNode address = operation.get(ModelDescriptionConstants.OP_ADDR); List<Property> list = address.asPropertyList(); Property alias = null; for (Property p: list) { if (ElytronDescriptionConstants.ALIAS.equals(p.getName())) { alias = p; break; } } return alias; }
Add null check into transformOperationAddress(final ModelNode operation) and sameAlias(final OperationContext context, final ModelNode operation)
- is cloned by
-
WFLY-8106 Coverity static analysis, Dereference null return value, CredentialStoreAliasDefinition (elytron-subsystem)
- Closed