From e78753d501562f4658166406b3925630d9912798 Mon Sep 17 00:00:00 2001
From: Lev Walkin <vlm@lionet.info>
Date: Sat, 23 Jun 2007 17:02:00 +0000
Subject: [PATCH] REAL fixed; verify constraints as well

---
 skeletons/REAL.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/skeletons/REAL.c b/skeletons/REAL.c
index df5b9b36..5e93ac8a 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -453,16 +453,16 @@ asn_REAL2double(const REAL_t *st, double *dbl_value) {
 		return -1;
 	}
 
-	if((octv & 0x03) == 0x11) {
-		/* 8.5.6.4, case d) */
+	elen = (octv & 0x03);	/* bits 2 to 1; 8.5.6.4 */
+	if(elen == 0x03) {	/* bits 2 to 1 = 11; 8.5.6.4, case d) */
 		elen = st->buf[1];	/* unsigned binary number */
 		if(elen == 0 || st->size <= (int)(2 + elen)) {
 			errno = EINVAL;
 			return -1;
 		}
+		/* FIXME: verify constraints of case d) */
 		ptr = &st->buf[2];
 	} else {
-		elen = (octv & 0x03);
 		ptr = &st->buf[1];
 	}
 
-- 
GitLab