From 9a98566a9044d55ff8a74ad4b25048a7c0b2e4c3 Mon Sep 17 00:00:00 2001
From: roux <roux@mycompany.com>
Date: Wed, 15 Jul 2015 15:09:22 +0000
Subject: [PATCH] Fix a bug in asn1c (add another patch to asn1c).

Basically when skiping an unknown extension, asn1c
did read 24 bits per 24 bits and later on failed
if the remaining bits (up to 23) were superior
to 8.

The patch reads 1 bit per 1 bit.



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7704 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 cmake_targets/tools/build_helper               |  1 +
 openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0

diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 81d95c1c89..ef5216c3cb 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -371,6 +371,7 @@ install_asn1c_from_source(){
     svn co https://github.com/vlm/asn1c/trunk  /tmp/asn1c-r1516 -r 1516 > /tmp/log_compile_asn1c
     patch -p0 < $OPENAIR_DIR/openair-cn/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c
     patch -p0 < $OPENAIR_DIR/openair-cn/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c
+    patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c
     ./configure
     make > /tmp/log_compile_asn1c 2>&1
     $SUDO make install
diff --git a/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 b/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
new file mode 100644
index 0000000000..18dc516285
--- /dev/null
+++ b/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
@@ -0,0 +1,13 @@
+Index: skeletons/per_opentype.c
+===================================================================
+--- skeletons/per_opentype.c	(revision 1516)
++++ skeletons/per_opentype.c	(working copy)
+@@ -277,7 +306,7 @@
+ 	(void)constraints;
+ 	(void)sptr;
+ 
+-	while(per_get_few_bits(pd, 24) >= 0);
++	while(per_get_few_bits(pd, 1 /*24*/) >= 0);
+ 
+ 	rv.code = RC_OK;
+ 	rv.consumed = pd->moved;
-- 
GitLab