Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "ueIdLst" to "ueS1apIdPairList" so Test Controller Complies #39

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions TestCntlrStub/src/ts_utls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,11 @@ int tsSendResetReq(unsigned int resetType, int numOfUes, unsigned char *ueLst)
((ResetReq*)msgptr)->cause.causeVal = 1;

((ResetReq*)msgptr)->r.partialRst.numOfConn = numOfUes;
((ResetReq*)msgptr)->r.partialRst.ueIdLst = malloc(numOfUes);
memcpy(((ResetReq*)msgptr)->r.partialRst.ueIdLst, ueLst, numOfUes);
((ResetReq*)msgptr)->r.partialRst.ueS1apIdPairList = malloc(numOfUes);
Copy link
Member

@VinashakAnkitAman VinashakAnkitAman Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This malloc memory allocation and typecasting looks invalid. "ueIdLst" was a list of U32 UEId values, whereas "ueS1apIdPairList" is a list with structures of 3 U32 values inside each. I believe, this should be like:
((ResetReq*)msgptr)->r.partialRst.ueS1apIdPairList =
(NbUeS1apIdPair) malloc(sizeof(NbUeS1apIdPair) * numOfUes);

memcpy(((ResetReq*)msgptr)->r.partialRst.ueS1apIdPairList, ueLst, numOfUes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above comment, this memcpy here should be updated as well. Moreover, the "ueLst" variable needs to be updated for this function with the new structure of "ueS1apIdPairList".


tfwApi(RESET_REQ, msgptr);
free(((ResetReq*)msgptr)->r.partialRst.ueIdLst);
free(((ResetReq*)msgptr)->r.partialRst.ueS1apIdPairList);
free(msgptr);
}

Expand Down