From dae395e5a7738f013bfa014ea0cc24cd03d987d4 Mon Sep 17 00:00:00 2001 From: Thomas Sydorowski Date: Wed, 21 Aug 2024 13:34:05 -0400 Subject: [PATCH] Fix decoding of container data attributes when the contained type does not have a definition --- .../org/aaa4j/radius/core/packet/PacketCodec.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/aaa4j-radius-core/src/main/java/org/aaa4j/radius/core/packet/PacketCodec.java b/aaa4j-radius-core/src/main/java/org/aaa4j/radius/core/packet/PacketCodec.java index 3ef4a08..73ef4de 100644 --- a/aaa4j-radius-core/src/main/java/org/aaa4j/radius/core/packet/PacketCodec.java +++ b/aaa4j-radius-core/src/main/java/org/aaa4j/radius/core/packet/PacketCodec.java @@ -545,13 +545,15 @@ private List> decodeAttributes(CodecContext codecContext, List attributeDefinition = dictionary.getAttributeDefinition(nextType); - int numComplete = attributeDefinition.getAttributeCodec().decode(codecContext, attributeStack); + if (attributeDefinition != null) { + int numComplete = attributeDefinition.getAttributeCodec().decode(codecContext, attributeStack); - for (int i = 0; i < numComplete; i++) { - attributes.add(attributeStack.removeFirst()); - } + for (int i = 0; i < numComplete; i++) { + attributes.add(attributeStack.removeFirst()); + } - continue; + continue; + } } attributes.add(attributeStack.removeFirst());