Skip to content

DS_SendHkCmd snprintf buffer size arguments mismatch #153

Description

@chillfig

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
Bring in secure static code analysis updates from lunar gateway.
DS_SendHkCmd has 2 instances where sizing of the snprintf using a constant that isn't directly used to define the destination string.

To Reproduce
N/A

Expected behavior
Nothing functional. Ensures write limit is derived directly from the destination buffer's declared size. Prevents overflow of truncation in the event of a user changing the configuration.

Code snips

Status = snprintf(FilterTblName, CFE_MISSION_TBL_MAX_NAME_LENGTH, "DS.%s", DS_FILTER_TBL_NAME);

snprintf(PayloadPtr->FilterTblFilename, OS_MAX_PATH_LEN, "%s", FilterTblInfo.LastFileLoaded);

System observed on:

  • Hardware: aarch64
  • OS: Ubuntu 24.04.4 LTS
  • Versions 0cd8596 commit of apps/ds + 38eaf4244185bc70aa296f1d8df7687e2f13989d cFS bundle

Additional context
N/A

Reporter Info
Justin Figueroa, Vantage Systems Inc

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions