Avoid creating lazy empty sequence
@@ -183,7 +183,11 @@ protected ASN1Primitive buildObject(
return new BEROctetString(strings);
case SEQUENCE:
- if (lazyEvaluate)
+ if (defIn.getRemaining() < 1)
+ {
+ return DLFactory.EMPTY_SEQUENCE;
+ }
+ else if (lazyEvaluate)
{
return new LazyEncodedSequence(defIn.toByteArray());
}
@@ -293,7 +297,7 @@ ASN1EncodableVector readVector() throws IOException
return v;
}
- ASN1EncodableVector readVector(DefiniteLengthInputStream dIn) throws IOException
+ static ASN1EncodableVector readVector(DefiniteLengthInputStream dIn) throws IOException
{
if (dIn.getRemaining() < 1)
{
