Skip to content

POSIX OSAL: snprintf overlaps destination #916

@tbouvencourt

Description

@tbouvencourt

Describe the bug
The issue occurs in: osal/src/os/posix/src/os-impl-filesys.c
Function : OS_FileSysStartVolume_Impl()

Compilation error :

error: ‘snprintf’ argument 5 overlaps destination object ‘OS_filesys_table’ [-Werror=restrict]
176 | snprintf(local->system_mountpt, sizeof(local->system_mountpt),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177 | "%s/osal:%s", tmpdir, local->volume_name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To Reproduce
Following : Exercise 1 – Build and Run the cFE (from training document)

System observed on:

  • OS: PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
    NAME="Debian GNU/Linux"
  • GCC : gcc (Debian 14.2.0-19) 14.2.0

Recommendation
Introduce a temporary local copy

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