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:Siddharth Chandrasekaran <sidcha.dev@gmail.com>
Loading
Please sign in to comment