From b8e6896585f28fd751b95de27c5702c7328054bc Mon Sep 17 00:00:00 2001 From: free will <2647778488@qq.com> Date: Tue, 16 Mar 2021 10:22:31 +0800 Subject: [PATCH] add handle error: SignatureType --- src/main/java/component/SignatureType.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/component/SignatureType.java b/src/main/java/component/SignatureType.java index befefd3..b9c6b35 100644 --- a/src/main/java/component/SignatureType.java +++ b/src/main/java/component/SignatureType.java @@ -141,7 +141,12 @@ public class SignatureType implements TlvComponentBase, IEncodingAble { } // 尝试从 TLE-VALUE 中读取出一个非负整数 - long result= TLV.readNonNegativeInteger(block.getValue(),0,block.getLength().getVlIntValue2Int()); + long result= 0; + try { + result = TLV.readNonNegativeInteger(block.getValue(),0,block.getLength().getVlIntValue2Int()); + } catch (VlIntException e) { + throw new Error("SignatureType.wireDecode: Invalid SignatureType TLV"); + } if(result<0){ return false; }