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

Fix #2559, Improve CFE_SB_AllocateMessageBuffer error report #2560

Merged
merged 1 commit into from
Jul 2, 2024
Merged
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
10 changes: 8 additions & 2 deletions modules/sb/fsw/src/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,21 +2004,27 @@ CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t Pipe
CFE_SB_Buffer_t *CFE_SB_AllocateMessageBuffer(size_t MsgSize)
{
CFE_ES_AppId_t AppId;
char AppName[OS_MAX_API_NAME] = {""};
CFE_SB_BufferD_t *BufDscPtr;
CFE_SB_Buffer_t * BufPtr;
CFE_Status_t Status;

AppId = CFE_ES_APPID_UNDEFINED;
BufDscPtr = NULL;
BufPtr = NULL;

Status = CFE_ES_GetAppID(&AppId);

if (MsgSize > CFE_MISSION_SB_MAX_SB_MSG_SIZE)
{
CFE_ES_WriteToSysLog("%s: ZeroCopyGetPtr-Failed, MsgSize is too large\n", __func__);
CFE_ES_GetAppName(AppName, AppId, sizeof(AppName));
CFE_ES_WriteToSysLog("%s %s: Failed, requested size %ld larger than allowed %d\n",
AppName, __func__, MsgSize, CFE_MISSION_SB_MAX_SB_MSG_SIZE);
return NULL;
}

/* get callers AppId */
if (CFE_ES_GetAppID(&AppId) == CFE_SUCCESS)
if (Status == CFE_SUCCESS)
{
CFE_SB_LockSharedData(__func__, __LINE__);

Expand Down
Loading