From 2cb990080bb668a766cd13dfc9ec3ccbd4529cbf Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 8 Mar 2023 22:39:42 +0100 Subject: Fix null reference in TunnelEncapsAttribute --- .../java/com/lumaserv/bgp/protocol/attribute/TunnelEncapsAttribute.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/TunnelEncapsAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/TunnelEncapsAttribute.java index ee6941f..df3ee42 100644 --- a/src/main/java/com/lumaserv/bgp/protocol/attribute/TunnelEncapsAttribute.java +++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/TunnelEncapsAttribute.java @@ -165,9 +165,9 @@ public class TunnelEncapsAttribute implements PathAttribute { public static final int TYPE = Encapsulation.TYPE; WireGuard(byte[] src, int offset, int length) { + publicKey = new byte[32]; if (length == 32) { // Type 1 flags = 0; - publicKey = new byte[32]; System.arraycopy(src, offset, publicKey, 0, 32); } else if (length >= 4 + 32) { // Type 2 flags = src[offset] | FLAG_TYPE_2; -- cgit v1.2.3