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

TestReadWriteLseek has off by one error #761

Closed
jhnphm opened this issue Jan 15, 2021 · 0 comments · Fixed by #763 or #767
Closed

TestReadWriteLseek has off by one error #761

jhnphm opened this issue Jan 15, 2021 · 0 comments · Fixed by #763 or #767
Assignees
Labels
bug community unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@jhnphm
Copy link

jhnphm commented Jan 15, 2021

Describe the bug
TestReadWriteLseek calls strlen but fails to account for null terminator, causing garbage characters to be written to test log

To Reproduce
Build and run file-api-test
Depending on the contents of memory, bogus characters may be written to build/[arch]/default_[cpu]/Testing/Temporary/LastTest.log

Expected behavior
Valid characters in LastTest.log

Code snips
Should be size = strlen(buffer)+1

size = strlen(buffer);

System observed on:
Linux

Reporter Info
John N Pham, Northrop Grumman

@skliper skliper added this to the 6.0.0 milestone Jan 15, 2021
@skliper skliper added the bug label Jan 15, 2021
@skliper skliper self-assigned this Jan 15, 2021
@skliper skliper added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Jan 15, 2021
skliper added a commit to skliper/osal that referenced this issue Jan 15, 2021
astrogeco added a commit that referenced this issue Jan 21, 2021
Fix #761, Terminate string in TestReadWriteLseek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
3 participants