You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had the situation that I got weird errors because I tried to write text longer than the buffer can hold. There is no check for buffer length < write length.
Describe the solution expected
Add a check if CONFIG_NEX_UART_TRANS_COMMAND_FORMAT_BUFFER_SIZE is smaller then the amount of bytes to write, then return specific error.
Additional info
No response
The text was updated successfully, but these errors were encountered:
Hi @stijnb1234 ,
Thinking about the implementation, as the buffer cannot be resized at runtime, having an error code of a condition that cannot be recovered might not help.
What is your opinion about using abort?
Hi @stijnb1234, would you be interested in testing the code in the buffer-length-check branch?
Functions will return NEX_FAIL if an instruction cannot be formatted, with the current buffer size and required size being logged.
Be aware that this branch might have braking changes depending on what functions you are using.
Background and motivation
I've had the situation that I got weird errors because I tried to write text longer than the buffer can hold. There is no check for buffer length < write length.
Describe the solution expected
Add a check if CONFIG_NEX_UART_TRANS_COMMAND_FORMAT_BUFFER_SIZE is smaller then the amount of bytes to write, then return specific error.
Additional info
No response
The text was updated successfully, but these errors were encountered: