From 4709d67f92bf89c264e38fbf94e3324edd922ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 23 Apr 2013 10:39:50 +0200 Subject: Fix encoding of semi-constrained, extensible INTEGERs Given: Semi ::= INTEGER (Lb..MAX, ...) where Lb is an arbitrary integer, attempting to encode an integer less than Lb would cause the encoder to enter an infinite loop. --- lib/asn1/src/asn1rtt_uper.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/asn1/src/asn1rtt_uper.erl') diff --git a/lib/asn1/src/asn1rtt_uper.erl b/lib/asn1/src/asn1rtt_uper.erl index 320038caa2..a5035c6660 100644 --- a/lib/asn1/src/asn1rtt_uper.erl +++ b/lib/asn1/src/asn1rtt_uper.erl @@ -223,7 +223,7 @@ encode_integer1(C, Val) -> case VR = get_constraint(C, 'ValueRange') of no -> encode_unconstrained_number(Val); - {Lb,'MAX'} -> + {Lb,'MAX'} when Lb =< Val -> encode_semi_constrained_number(Lb, Val); %% positive with range {Lb,Ub} when Val >= Lb, Ub >= Val -> -- cgit v1.2.3