forked from rideskip/anchor
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
In console.c, in console_process() around line 700, static analysis tools pick up an unsafe usage of strcpy. After review, it is probably not a problem as both m_line_buffer and history_line are declared as fixed length arrays of the same size, but even only a disposition complicates the certification of safety-critical systems.
One possible option would be to wipe m_line_buffer with '\0' then using strncpy limited to the length of m_line_buffer, like:
memset(m_line_buffer, '\0', sizeof(m_line_buffer));
strncpy(m_line_buffer, history_line, sizeof(m_line_buffer)-1);
This would ensure that m_line_buffer is always null-terminated no matter what.
However, this requires review as it may conflict with erase_current_line() called before.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels