Skip to content
Commit 061a87af authored by Siddharth Chandrasekaran's avatar Siddharth Chandrasekaran Committed by Carles Cufí
Browse files

mgmt/osdp: Replace __ASSERT() with an explicit if



Commit c7fec711 ("mgmt/osdp: Add length checks for commands and
replies") attempted to remove code duplication by adding a macro to perform
a length check. At the time, a CI linter did not like macros with control
flow so the code was switched to a method which called __ASSERT() on this
condition.

The __ASSERT() macro is a nop if CONFIG_ASSERT=n (which is the default) and
causes the buffer access to be unguarded which may lead to OOB accesses.
This patch fixes the issue by reintroducing the if check.

Fixes: c7fec711.
Signed-off-by: default avatarSiddharth Chandrasekaran <sidcha.dev@gmail.com>
parent d2bd778b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment