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 #63, clean up strncpy calls #65

Merged
merged 1 commit into from
Nov 17, 2022
Merged

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Call "strncpy" with the size parameter indicating the size of the destination buffer, rather than the input string length.

A buffer overflow was avoided due to a length check already in the code, but calling the function properly should avoid a warning.

Fixes #63

Testing performed
Build and run all tests
Send the FM_GET_DIR_FILE_CC and FM_GET_DIR_PKT_CC and confirm correct behavior.

Expected behavior changes
No compiler warnings.
No change to functionality.

System(s) tested on
Ubuntu 22.04

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Call "strncpy" with the size parameter indicating the size of the
destination buffer, rather than the input string length.

A buffer overflow was avoided due to a length check already in the code,
but calling the function properly should avoid a warning.
@jphickey
Copy link
Contributor Author

Note - "Build and Run" workflow is now passing, log here: https://github.com/nasa/FM/actions/runs/3463996146

Other errors remain but those will be fixed by separate PRs.

@dzbaker dzbaker merged commit c4063cc into nasa:main Nov 17, 2022
@dmknutsen dmknutsen added this to the Draco milestone Jan 18, 2023
@jphickey jphickey deleted the fix-63-fm-strncpy branch March 7, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New GCC warnings causing build failure [-Werror=stringop-overflow=]
3 participants