drivers: sensor: fcx_mldx5: Fix potential buffer overflow in UART frame
Fix Coverity issue CID 363738 (CWE-120): A potential buffer overflow could
occur in fcx_mldx5_uart_send() due to unchecked memcpy() when copying
command data into a fixed-size frame buffer.
This patch ensures that the length of the data being copied validated
against the remaining buffer size to prevent overruns. Also replaces a
redundant strlen() call with the precomputed cmd_data_len.
Fixes: #92634
Signed-off-by:
sudarsan N <sudarsansamy2002@gmail.com>
Loading
Please sign in to comment