Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmt/osdp: Fix couple of issues identified by coverity #33098

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

sidcha
Copy link
Member

@sidcha sidcha commented Mar 7, 2021

Fix couple of issues identified by coverity.

Fixes: #33095
Fixes: #33092

Fix a coverity identified, off-by-one, out-of-bound array access at
pd->cap[].

CID: 215379
Fixes: zephyrproject-rtos#33095
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
@sidcha sidcha added Coverity A Coverity detected issue or its fix area: OSDP Open Supervised Device Protocol - subsys/mgmt/osdp labels Mar 7, 2021
@nashif nashif requested review from carlescufi and ceolin March 9, 2021 14:27
subsys/mgmt/osdp/src/osdp_cp.c Show resolved Hide resolved
A previous check and return for (maxlen <= 0) makes manlen at least 1 so
checks for (maxlen < 1) would never evaluate to true. Remove these
checks and merge those cases into one.

CID: 215392
Fixes: zephyrproject-rtos#33092
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
@nashif nashif merged commit 28c823b into zephyrproject-rtos:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: OSDP Open Supervised Device Protocol - subsys/mgmt/osdp Coverity A Coverity detected issue or its fix
Projects
None yet
3 participants