nasa / nasa/SC

Address sanitizer flagged stack buffer overflows in sc_loads_tests.c

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
46
Forks
39
PR merge metrics
No merged PRs in 30d

Description

I enabled the address sanitizer and it flagged

SC_LoadAts_Test_AtsEntryOverflow(void)

https://github.com/nasa/SC/blob/draco-rc5/unit-test/sc_loads_tests.c#L412

for a stack buffer overflows.

The issue, is that the function

AtsTable size is too small.

https://github.com/nasa/SC/blob/draco-rc5/unit-test/sc_loads_tests.c#L416

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open unit-test/sc_loads_tests.c around lines 412 and 416, starting with SC_LoadAts_Test_AtsEntryOverflow(void) and the AtsTable declaration. Run this test with AddressSanitizer to reproduce the stack buffer overflow. Done means the test no longer reports an overflow after the AtsTable size is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.