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 #71, table processing fixes #73

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Mar 21, 2023

Checklist (Please check before submitting)

Describe the contribution
First check that table name is null-terminated before comparing any strings, then the normal strcmp() can be safely used. This reverses the direction of the inner check loop, so it is reading entries that have been already validated otherwise, rather than reading entries that have not yet been checked at all.

Fixes #61
Fixes #71

Testing performed
Build and run CS and all tests

Expected behavior changes
Un-terminated/Long table names will be detected as part of validation. Importantly, the code no longer invokes strlen() on a string that has not been checked for null termination.

System(s) tested on
Debian

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

First check that table name is null-terminated before comparing any
strings, then the normal strcmp() can be safely used.  This reverses the
direction of the inner check loop, so it is reading entries that have
been already validated otherwise, rather than reading entries that have
not yet been checked at all.
@github-advanced-security
Copy link

You have successfully added a new CppCheck configuration cppcheck. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@jphickey
Copy link
Contributor Author

jphickey commented Mar 21, 2023

Also Fixes #61, duplicate issue

@dzbaker dzbaker merged commit 591d082 into nasa:main Mar 23, 2023
@jphickey jphickey deleted the fix-71-tbl-strncmp branch March 27, 2023 17:46
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants