Skip to content

Flagged txm_module_object_pointer_get as deprecated#562

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

Flagged txm_module_object_pointer_get as deprecated#562
fdesbiens wants to merge 1 commit into
eclipse-threadx:devfrom
fdesbiens:fdesbiens/flag-deprecations

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

Summary

txm_module_object_pointer_get() passes UINT_MAX as the name-buffer length to the underlying _extended search. If name points to a buffer shorter than the name being compared, the comparison loop reads past the end of the buffer (undefined behaviour). Callers must use txm_module_object_pointer_get_extended() and supply the actual buffer length.

Changes

  • common_modules/module_lib/src/txm_module_object_pointer_get.c: prominent deprecation comment block + #pragma message compile-time warning.
  • common_modules/module_manager/src/txm_module_manager_object_pointer_get.c: updated DESCRIPTION block.

Companion

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

Added #pragma message compile-time warning to the module library
source and updated the DESCRIPTION blocks in both the library and
manager implementations.

Reason: this wrapper passes UINT_MAX as the name-buffer length to
the underlying extended search. The comparison loop can therefore
read past the end of a short name buffer, which is undefined
behaviour. Callers should use txm_module_object_pointer_get_extended()
and supply the actual buffer length.

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