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 #2553, null value in vsnprintf #2554

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

avan989
Copy link
Contributor

@avan989 avan989 commented Apr 26, 2024

Fix #2553, fix test that was passing null value
into vsnprintf

Checklist (Please check before submitting)

Describe the contribution
A clear and concise description of what the contribution is.

  • Include explicitly what issue it addresses [e.g. Fixes #X]

Fixes #2553, address issue that occur when running with address sanitizer. One of the coverage test was trying to pass an
null value to force an return code of 0 or less to an vsnprintf. Passing an null value as an input is an undefine behavior but you can achieve the same result by passing in an empty string which will force the return code to be 0.

Testing performed
Steps taken to test the contribution:
add the following options:
add_compile_options(-fsanitize=address -g)
add_link_options(-fsanitize=address)

  1. make ENABLE_UNIT_TESTS=true SIMULATION=native prep
  2. make install
  3. make test
  4. make lcov

Expected behavior changes
A clear and concise description of how this contribution will change behavior and level of impact.

no more error when running with fsanitize.
Still 100% coverage.
Capture
Capture1

System(s) tested on

  • Hardware: [e.g. PC, SP0, MCP750]
  • OS: [e.g. Ubuntu 18.04, RTEMS 4.11, VxWorks 6.9]
  • Versions: [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for mcp750, any related apps or tools]

Additional context
Add any other context about the contribution here.

Third party code
If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request
Full name and company/organization/center of all contributors ("Personal" if individual work)

  • Note CLAs apply to only software contributions.
    Anh Van, GSFC

Fix nasa#2553, fix test that was passing null value
into vsnprintf
@dmknutsen dmknutsen added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jun 3, 2024
@dzbaker dzbaker added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Jun 27, 2024
dzbaker added a commit to nasa/cFS that referenced this pull request Jul 2, 2024
*Combines:*

cFE equuleus-rc1+dev137
osal equuleus-rc1+dev66
elf2cfetbl equuleus-rc1+dev56

**Includes:**

*cFS*
- #707
- #773

*cFE*
- nasa/cFE#2560
- nasa/cFE#2344
- nasa/cFE#2359
- nasa/cFE#2376
- nasa/cFE#2496
- nasa/cFE#2554
- nasa/cFE#2568
- nasa/cFE#2566

*osal*
- nasa/osal#1456
- nasa/osal#1465

*elf2cfetbl*
- nasa/elf2cfetbl#147
- nasa/elf2cfetbl#124
- nasa/elf2cfetbl#125
- nasa/elf2cfetbl#127

Co-authored by: Avi Weiss <[email protected]>
Co-authored by: Justin Figueroa <[email protected]>
Co-authored by: Joseph Hickey <[email protected]>
Co-authored by: Jacob Hageman <[email protected]>
Co-authored by: Anh Van <[email protected]>
@dzbaker dzbaker mentioned this pull request Jul 2, 2024
2 tasks
dzbaker added a commit to nasa/cFS that referenced this pull request Jul 2, 2024
*Combines:*

cFE equuleus-rc1+dev137
osal equuleus-rc1+dev66
elf2cfetbl equuleus-rc1+dev56

**Includes:**

*cFS*
- #707
- #773

*cFE*
- nasa/cFE#2560
- nasa/cFE#2344
- nasa/cFE#2359
- nasa/cFE#2376
- nasa/cFE#2496
- nasa/cFE#2554
- nasa/cFE#2568
- nasa/cFE#2566

*osal*
- nasa/osal#1456
- nasa/osal#1465

*elf2cfetbl*
- nasa/elf2cfetbl#147
- nasa/elf2cfetbl#124
- nasa/elf2cfetbl#125
- nasa/elf2cfetbl#127

Co-authored by: Avi Weiss <[email protected]>
Co-authored by: Justin Figueroa <[email protected]>
Co-authored by: Joseph Hickey <[email protected]>
Co-authored by: Jacob Hageman <[email protected]>
Co-authored by: Anh Van <[email protected]>
@dzbaker dzbaker merged commit 4990c4e into nasa:main Jul 2, 2024
22 checks passed
dzbaker added a commit to nasa/cFS that referenced this pull request Jul 2, 2024
*Combines:*

cFE equuleus-rc1+dev137
osal equuleus-rc1+dev66
elf2cfetbl equuleus-rc1+dev56

**Includes:**

*cFS*
- #707
- #773

*cFE*
- nasa/cFE#2560
- nasa/cFE#2344
- nasa/cFE#2359
- nasa/cFE#2376
- nasa/cFE#2496
- nasa/cFE#2554
- nasa/cFE#2568
- nasa/cFE#2566

*osal*
- nasa/osal#1456
- nasa/osal#1465

*elf2cfetbl*
- nasa/elf2cfetbl#147
- nasa/elf2cfetbl#124
- nasa/elf2cfetbl#125
- nasa/elf2cfetbl#127

Co-authored by: Avi Weiss <[email protected]>
Co-authored by: Justin Figueroa <[email protected]>
Co-authored by: Joseph Hickey <[email protected]>
Co-authored by: Jacob Hageman <[email protected]>
Co-authored by: Anh Van <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

address sanitizer option detect segv in es_UT.c
3 participants