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

MD Dwell Table Tests String Error #47

Closed
2 tasks done
colteye opened this issue Feb 7, 2023 · 0 comments · Fixed by #57
Closed
2 tasks done

MD Dwell Table Tests String Error #47

colteye opened this issue Feb 7, 2023 · 0 comments · Fixed by #57
Assignees
Milestone

Comments

@colteye
Copy link

colteye commented Feb 7, 2023

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
While compiling the latest version of MD with unit tests enabled, my build environment gave me the following error:

error: 'MD_UpdateTableSignature' accessing 32 bytes in a region of size 13 [-Werror=stringop-overflow=]

Code snips
The bug relates to this line and a few others with the same variable used for testing MD signatures. It seems as though the compiler does not like that newsignature is implicitly a 13 byte string as opposed to a 32 byte string, which is what the function MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_FIELD_LENGTH]) expects

char newsignature[] = "newsignature";

For now, simply explicitly using the size of the array in the variable definition seems to work successfully.

char   newsignature[MD_SIGNATURE_FIELD_LENGTH] = "newsignature";

After changing to this locally wherever it appeared, my build works fine.

skliper added a commit to skliper/MD that referenced this issue Aug 2, 2023
@skliper skliper self-assigned this Aug 2, 2023
dzbaker added a commit that referenced this issue Aug 31, 2023
Fix #47, Explictly size MD dwell table unit test string
@chillfig chillfig added this to the Equuleus milestone Sep 5, 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 a pull request may close this issue.

3 participants