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 #2529, Reduces CFE_EVS_MAX_PORT_MSG_LENGTH to prevent new line character truncation #2566

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
13 changes: 8 additions & 5 deletions modules/evs/fsw/src/cfe_evs_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@
#define CFE_EVS_MAX_FILTER_COUNT 65535
#define CFE_EVS_MAX_SQUELCH_COUNT 255
#define CFE_EVS_PIPE_NAME "EVS_CMD_PIPE"
#define CFE_EVS_MAX_PORT_MSG_LENGTH (CFE_MISSION_EVS_MAX_MESSAGE_LENGTH + OS_MAX_API_NAME + 30)
#define CFE_EVS_MAX_PORT_MSG_LENGTH (CFE_MISSION_EVS_MAX_MESSAGE_LENGTH + OS_MAX_API_NAME + 19)

/* Since CFE_EVS_MAX_PORT_MSG_LENGTH is the size of the buffer that is sent to
* print out (using OS_printf), we need to check to make sure that the buffer
* size the OS uses is big enough. This check has to be made here because it is
* the first spot after CFE_EVS_MAX_PORT_MSG_LENGTH is defined */
#if OS_BUFFER_SIZE < CFE_EVS_MAX_PORT_MSG_LENGTH
#error CFE_EVS_MAX_PORT_MSG_LENGTH cannot be greater than OS_BUFFER_SIZE!
* size the OS uses is big enough. The buffer needs to have at least 11 extra
* characters to accommodate the format string "EVS Port%u %s\n" used in
* downstream processing for sending messages via ports. This check has to be
* made here because it is the first spot after CFE_EVS_MAX_PORT_MSG_LENGTH
* is defined. */
#if OS_BUFFER_SIZE < CFE_EVS_MAX_PORT_MSG_LENGTH + 11
#error CFE_EVS_MAX_PORT_MSG_LENGTH cannot be greater than OS_BUFFER_SIZE - 11!
#endif

/************************ Internal Structure Definitions *****************************/
Expand Down
Loading