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 #444, Adds JSC 2.1 Static Analysis comments and exposes CF_strnlen #448

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

chillfig
Copy link
Contributor

@chillfig chillfig commented Jun 6, 2024

Checklist (Please check before submitting)

Describe the contribution

  • Fixes Static analysis issues JSC 2.1 #444, Adds comments in the fsw to document where static analysis warnings have been flagged and why it's ok to leave the code in its current state.

Testing performed
None, only comments are added.

Expected behavior changes
N/A

System(s) tested on
N/A

Additional context
Depends on nasa/osal#1465

Third party code
N/A

Contributor Info - All information REQUIRED for consideration of pull request
Justin Figueroa, Vantage Systems

@chillfig chillfig added bug CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Jun 6, 2024
@chillfig chillfig self-assigned this Jun 6, 2024
@chillfig chillfig force-pushed the SA_jsc2_1 branch 2 times, most recently from ac96459 to b532de9 Compare June 10, 2024 19:43
@chillfig chillfig changed the title Fix #444, Adds JSC 2.1 Static Analysis comments Fix #444, Adds JSC 2.1 Static Analysis comments and exposes CF_strnlen Jun 18, 2024
snprintf(linebuf, sizeof(linebuf), "DST: %s\n", history->fnames.dst_filename);
break;
}

/* SAD: Using strlen since linebuf is guaranteed to be null-terminated by snprintf */
len = strlen(linebuf);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CCB 06/13/2024: Consider using memchr. Check if return null. Can create App_strnlen() locally static inline if deemed applicable.

Copy link
Contributor Author

@chillfig chillfig Jun 20, 2024

Choose a reason for hiding this comment

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

app-scope CF_strlen using memchar has been implemented where strlen was previously used

This commit addresses issues flagged during static analysis by:
- Adding JSC 2.1 disposition comments.
- Replacing strlen with OS_strnlen.
@dzbaker dzbaker added CCB:Approved and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Jun 27, 2024
@dzbaker
Copy link
Contributor

dzbaker commented Jun 27, 2024

CCB 27 June 2024: Will re-run workflows once osal#1465 is merged in to verify they pass.

@dzbaker dzbaker merged commit 7639e40 into nasa:main Jul 2, 2024
16 checks passed
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.

Static analysis issues JSC 2.1
2 participants