Skip to content

Flagged six FileX APIs as deprecated#95

Open
fdesbiens wants to merge 1 commit into
eclipse-threadx:devfrom
fdesbiens:fdesbiens/flag-deprecations
Open

Flagged six FileX APIs as deprecated#95
fdesbiens wants to merge 1 commit into
eclipse-threadx:devfrom
fdesbiens:fdesbiens/flag-deprecations

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

Summary

Six FileX functions omit a destination buffer-length parameter and use a fixed or hardcoded limit. They can cause buffer overruns in the caller. Each has an _extended replacement that accepts an explicit buffer size.

Deprecated Replacement Fixed limit
fx_directory_long_name_get fx_directory_long_name_get_extended FX_MAX_LONG_NAME_LEN
fx_directory_short_name_get fx_directory_short_name_get_extended FX_MAX_SHORT_NAME_LEN
fx_media_volume_get fx_media_volume_get_extended 12
fx_unicode_length_get fx_unicode_length_get_extended 256
fx_unicode_name_get fx_unicode_name_get_extended FX_MAX_LONG_NAME_LEN*2
fx_unicode_short_name_get fx_unicode_short_name_get_extended 13

Changes

Added #pragma message compile-time warnings and updated DESCRIPTION blocks in all six source files.

Companion

Docs: eclipse-threadx/rtos-docs-asciidoc#33 (pending)

Added #pragma message compile-time warnings and updated DESCRIPTION
blocks in:
  - fx_directory_long_name_get      -> use _extended (buffer size)
  - fx_directory_short_name_get     -> use _extended (buffer size)
  - fx_media_volume_get             -> use _extended (buffer size)
  - fx_unicode_length_get           -> use _extended (buffer size)
  - fx_unicode_name_get             -> use _extended (buffer size)
  - fx_unicode_short_name_get       -> use _extended (buffer size)

All six functions omit a destination buffer length parameter and use a
fixed or hardcoded limit, which can cause buffer overruns in the caller.
The corresponding _extended variants accept an explicit buffer size and
must be used instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant