nasa / FM

The Core Flight System (cFS) File Manager (FM) application.
Apache License 2.0
42 stars 24 forks source link

Fix #63, clean up strncpy calls #65

Closed jphickey closed 1 year ago

jphickey commented 1 year ago

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.

jphickey commented 1 year ago

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.