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

Fixing undefined behavior in lib CRC #2269

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

LeStarch
Copy link
Collaborator

@LeStarch LeStarch commented Sep 6, 2023

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s)
Has Unit Tests (y/n)
Builds Without Errors (y/n)
Unit Tests Pass (y/n)
Documentation Included (y/n)

Change Description

A lack of casting in libcrc tripped the undefined behavior and address sanitizers when running update_crc_16. This occurs when the result is -1 and passed as an index. By forcing a cast to unsigned int, the index should be guided back into a non-negative range.

Future Work

We should search for and possible baseline a flight-quality implementation of CRCs/

@LeStarch LeStarch requested a review from thomas-bc September 6, 2023 22:10
@LeStarch LeStarch merged commit 87fa458 into nasa:devel Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants