Commit 691cab6f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix Cmake warnings

parent 90d05403
......@@ -2531,9 +2531,10 @@ void amf_n1::encode_nas_message_protected(
protected_nas_buf[0] = EPD_5GS_MM_MSG;
protected_nas_buf[1] = INTEGRITY_PROTECTED_AND_CIPHERED;
protected_nas_buf[6] = (uint8_t) nsc->dl_count.seq_num;
// if (bdata(ciphered) != nullptr)
memcpy(
&protected_nas_buf[7], (uint8_t*) bdata(ciphered), blength(ciphered));
uint8_t* buf_tmp = (uint8_t*) bdata(ciphered);
if (buf_tmp != nullptr)
memcpy(&protected_nas_buf[7], (uint8_t*) buf_tmp, blength(ciphered));
uint32_t mac32;
if (!(nas_message_integrity_protected(
......
......@@ -907,7 +907,8 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
if (gc.get()->ue_radio_cap_ind) {
bstring ueCapability = gc.get()->ue_radio_cap_ind;
uint8_t* uecap = (uint8_t*) calloc(1, blength(ueCapability) + 1);
memcpy(uecap, (uint8_t*) bdata(ueCapability), blength(ueCapability));
uint8_t* buf_tmp = (uint8_t*) bdata(ueCapability);
if (buf_tmp != nullptr) memcpy(uecap, buf_tmp, blength(ueCapability));
uecap[blength(ueCapability)] = '\0';
msg->setUERadioCapability(uecap, (size_t) blength(ueCapability));
free(uecap);
......@@ -1028,7 +1029,8 @@ void amf_n2::handle_itti_message(
PDUSessionResourceSetupRequestItem_t item = {};
item.pduSessionId = itti_msg.pdu_session_id;
uint8_t* nas_pdu = (uint8_t*) calloc(1, blength(itti_msg.nas) + 1);
memcpy(nas_pdu, (uint8_t*) bdata(itti_msg.nas), blength(itti_msg.nas));
uint8_t* buf_tmp = (uint8_t*) bdata(itti_msg.nas);
if (buf_tmp != nullptr) memcpy(nas_pdu, buf_tmp, blength(itti_msg.nas));
nas_pdu[blength(itti_msg.nas)] = '\0';
item.pduSessionNAS_PDU = nas_pdu;
item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas);
......@@ -1136,7 +1138,8 @@ void amf_n2::handle_itti_message(
item.s_nssai.sst = itti_msg.s_NSSAI.getSst();
uint8_t* nas_pdu = (uint8_t*) calloc(1, blength(itti_msg.nas) + 1);
memcpy(nas_pdu, (uint8_t*) bdata(itti_msg.nas), blength(itti_msg.nas));
uint8_t* buf_tmp = (uint8_t*) bdata(itti_msg.nas);
if (buf_tmp != nullptr) memcpy(nas_pdu, buf_tmp, blength(itti_msg.nas));
nas_pdu[blength(itti_msg.nas)] = '\0';
item.pduSessionNAS_PDU = nas_pdu;
item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas);
......@@ -1201,7 +1204,8 @@ void amf_n2::handle_itti_message(
release_cmd_msg->setAmfUeNgapId(itti_msg.amf_ue_ngap_id);
release_cmd_msg->setRanUeNgapId(itti_msg.ran_ue_ngap_id);
uint8_t* nas_pdu = (uint8_t*) calloc(1, blength(itti_msg.nas) + 1);
memcpy(nas_pdu, (uint8_t*) bdata(itti_msg.nas), blength(itti_msg.nas));
uint8_t* buf_tmp = (uint8_t*) bdata(itti_msg.nas);
if (buf_tmp != nullptr) memcpy(nas_pdu, buf_tmp, blength(itti_msg.nas));
nas_pdu[blength(itti_msg.nas)] = '\0';
release_cmd_msg->setNasPdu(nas_pdu, blength(itti_msg.nas));
......
......@@ -104,7 +104,8 @@ int Payload_Container::encode2buffer(uint8_t* buf, int len) {
encoded_size++;
*(buf + encoded_size) = (blength(content) & 0x00ff);
encoded_size++;
memcpy(buf + encoded_size, (uint8_t*) bdata(content), blength(content));
uint8_t* buf_tmp = (uint8_t*) bdata(content);
if (buf_tmp != nullptr) memcpy(buf + encoded_size, buf_tmp, blength(content));
encoded_size += blength(content);
#if 0
......
......@@ -326,6 +326,7 @@ void RerouteNASRequest::setNgapMessage(OCTET_STRING_t& message) {
//------------------------------------------------------------------------------
bool RerouteNASRequest::getNgapMessage(OCTET_STRING_t& message) const {
message = ngapMessage;
return true;
}
//------------------------------------------------------------------------------
void RerouteNASRequest::setAMFSetID(const std::string& amf_set_id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment