Skip to content

Wrong type of arguments to snprintf #362

@ArielSAdamsNASA

Description

@ArielSAdamsNASA

Describe the bug
Function call with incorrect argument type. This argument should be of type 'unsigned int' but is of type 'PCS_WIND_TCB *'.

Expected behavior
Same behavior, fix error

Code snips

snprintf(ReasonBuf, ReasonSize, "Vector=0x%06X, vxWorks Task Name=%s, Task ID=0x%08X", Buffer->context_info.vector,
TaskName, Buffer->sys_task_id);

System observed on:
VxWorks 6.9/MCP750

Additional context
From CodeQL
Use "%08lX" as the format and explicitly cast the argument as "(unsigned long)"

Reporter Info
Ariel Adams, MCSG Tech

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions