From 48d1962ada388298ff50dc7b696a05f757beb38f Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Thu, 30 Apr 2015 09:14:54 +0000
Subject: [PATCH] Sebastian Held
 patches15/0007-fix-invalid-memory-accesses.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7309 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/RRC/LITE/MESSAGES/asn1_msg.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
index 0eec5bbbc1..28c80941b1 100644
--- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
@@ -2418,14 +2418,12 @@ uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t
   return encoded;
 }
 
-//OAI_UECapability_t *fill_ue_capability(void) {
 OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
 {
   static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */
-  SupportedBandEUTRA_t Bandlist[4];
-  // BandInfoEUTRA_t BandInfo_meas[4];
-  InterFreqBandInfo_t InterFreqBandInfo[4][4];
-  BandInfoEUTRA_t BandInfoEUTRA[4];
+  static SupportedBandEUTRA_t Bandlist[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it
+  static InterFreqBandInfo_t InterFreqBandInfo[4][4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it
+  static BandInfoEUTRA_t BandInfoEUTRA[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it
 
   asn_enc_rval_t enc_rval;
   asn_dec_rval_t dec_rval;
@@ -2447,7 +2445,6 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
     Bandlist[0].bandEUTRA  = 3;  // UL 1710-1785, DL 1805-1880 FDD
     Bandlist[0].halfDuplex = 0;
     Bandlist[1].bandEUTRA  = 20;  // UL 824-849 , DL 869-894 FDD
-
     Bandlist[1].halfDuplex = 0;
     Bandlist[2].bandEUTRA  = 7;   // UL 2500-2570, DL 2620-2690 FDD
     Bandlist[2].halfDuplex = 0;
-- 
GitLab