Skip to content

Address Sanitizer flags a test in fs_UT.c as having a READ buffer overflow #2650

@myc-yang

Description

@myc-yang

I enabled the address sanitizer and ran the coverage-fs-ALL test when it flagged a READ buffer overflow at this line here:

https://github.com/nasa/cFE/blob/main/modules/fs/ut-coverage/fs_UT.c#L341

UtAssert_INT32_EQ(CFE_FS_ParseInputFileNameEx(OutBuffer, "/path/", sizeof(OutBuffer), 10, NULL, TEST_DEFAULT_PATH,
                                              TEST_DEFAULT_EXTENSION),

I believe the issue is that while the input buffer ("/path/") is only 7 (including the null-terminator), the input buffer length is set to 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions