Skip to content
Commit 73127159 authored by sudarsan N's avatar sudarsan N Committed by Benjamin Cabé
Browse files

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: default avatarsudarsan N <sudarsansamy2002@gmail.com>
parent a0223945
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment