From 252174865ceae75a9f907bc3e399f8500d43cf38 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 27 Feb 2018 14:24:27 +0100 Subject: [PATCH] fix coverity issue --- srsepc/src/mme/mme_gtpc.cc | 3 ++- srsepc/src/mme/s1ap.cc | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/srsepc/src/mme/mme_gtpc.cc b/srsepc/src/mme/mme_gtpc.cc index 0c36541c0..4e5d2ad7d 100644 --- a/srsepc/src/mme/mme_gtpc.cc +++ b/srsepc/src/mme/mme_gtpc.cc @@ -118,7 +118,8 @@ mme_gtpc::send_create_session_request(uint64_t imsi, uint32_t mme_ue_s1ap_id) m_mme_gtpc_log->console("Creating Session Response -- IMSI: %015lu \n", imsi); m_mme_gtpc_log->console("Creating Session Response -- MME control TEID: %lu \n", cs_req->sender_f_teid.teid); // APN - strcpy(cs_req->apn, m_s1ap->m_s1ap_args.mme_apn.c_str()); + strncpy(cs_req->apn, m_s1ap->m_s1ap_args.mme_apn.c_str(), sizeof(cs_req->apn)-1); + cs_req->apn[sizeof(cs_req->apn)-1] = 0; // RAT Type //cs_req->rat_type = srslte::GTPC_RAT_TYPE::EUTRAN; diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 8d25fed11..80d8b6d74 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -38,7 +38,9 @@ boost::mutex s1ap_instance_mutex; s1ap::s1ap(): m_s1mme(-1), - m_next_mme_ue_s1ap_id(1) + m_next_mme_ue_s1ap_id(1), + m_mme_gtpc(NULL), + m_pool(NULL) { }