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 #805, Null terminate when using strncpy #807

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

skliper
Copy link
Contributor

@skliper skliper commented Feb 11, 2021

Describe the contribution
Fix #805 - fixed a couple missing null terminations and applied the general pattern (sizeof where it works)

Testing performed
Build and execute unit tests

Expected behavior changes
Avoid missing null termination issues, no longer truncating filename in OS_ModuleInfo (src/os/shared/src/osapi-module.c)

System(s) tested on

  • Hardware: cFS Dev Server
  • OS: Ubuntu 18.04
  • Versions: cFS Bundle main + this commit

Additional context
None

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 6.0.0 milestone Feb 11, 2021
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the sizeof() updates.
Note that for the two cases of strcpy it was already length-checked earlier in the function - so not a buffer overflow. But using strncpy is fine, if a bit redundant.

@skliper
Copy link
Contributor Author

skliper commented Feb 12, 2021

Yeah, saw that these weren't all actual bugs... but following the pattern is easier for quick compliance checks.

@astrogeco astrogeco changed the base branch from main to integration-candidate February 12, 2021 20:40
@astrogeco astrogeco merged commit a97e4f9 into nasa:integration-candidate Feb 12, 2021
@skliper skliper deleted the fix805-null_termination branch April 1, 2021 20:07
jphickey pushed a commit to jphickey/osal that referenced this pull request Aug 10, 2022
jphickey pushed a commit to jphickey/osal that referenced this pull request Aug 10, 2022
Fix nasa#807, Add ES Application Behavior Functional Tests
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.

Improper Null termination
3 participants