Skip to content

Commit

Permalink
cp: Fix segfault in osdp_cp_teardown()
Browse files Browse the repository at this point in the history
osdp_cp_teardown() calls osdp_to_pd(ctx, 0) for all loop entries which
causes a segfault.

This issue was repported and fixed-by Marek Felskowski over email.

Fixes: 2e07d66
Authored-by: Marek Felskowski <[email protected]>
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Jul 29, 2024
1 parent eaacfc6 commit cf4e4b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/osdp_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ void osdp_cp_teardown(osdp_t *ctx)
if (IS_ENABLED(CONFIG_OSDP_PACKET_TRACE) ||
IS_ENABLED(CONFIG_OSDP_DATA_TRACE)) {
for (i = 0; i < NUM_PD(ctx); i++) {
pd = osdp_to_pd(ctx, 0);
pd = osdp_to_pd(ctx, i);
osdp_packet_capture_finish(pd);
}
}
Expand Down

0 comments on commit cf4e4b9

Please sign in to comment.