Commit 9d5d78f5 authored by David Price's avatar David Price

Stack smashing error reported. Fixed by parameter changing int to uint16_t. Not obvious!

parent f7670c4b
......@@ -1109,7 +1109,7 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
return 0;
}
extern void subtract_subframe(int *frameP, int *subframeP, int offset);
extern void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
{
......
......@@ -291,8 +291,8 @@ int vnf_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessag
void install_schedule_handlers(IF_Module_t *if_inst);
extern int single_thread_flag;
extern void init_eNB_afterRU(void);
extern void add_subframe(int *frameP, int *subframeP, int offset);
extern void subtract_subframe(int *frameP, int *subframeP, int offset);
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
extern void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
void oai_create_enb(void)
{
......
......@@ -63,20 +63,20 @@
#include "T.h"
void add_subframe(int *frameP, int *subframeP, int offset)
void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset)
{
*frameP = *frameP + ((*subframeP + offset) / 10);
*subframeP = ((*subframeP + offset) % 10);
}
uint16_t sfnsf_add_subframe(int frameP, int subframeP, int offset)
uint16_t sfnsf_add_subframe(uint16_t frameP, uint16_t subframeP, int offset)
{
add_subframe(&frameP, &subframeP, offset);
return frameP<<4|subframeP;
}
void subtract_subframe(int *frameP, int *subframeP, int offset)
void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset)
{
if (*subframeP < offset)
{
......@@ -85,7 +85,7 @@ void subtract_subframe(int *frameP, int *subframeP, int offset)
*subframeP = (*subframeP+10-offset)%10;
}
uint16_t sfnsf_subtrace_subframe(int frameP, int subframeP, int offset)
uint16_t sfnsf_subtract_subframe(uint16_t frameP, uint16_t subframeP, int offset)
{
subtract_subframe(&frameP, &subframeP, offset);
return frameP<<4|subframeP;
......
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