Skip to content

Commit

Permalink
python: Fix potential null-ptr-deref during event callback
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Jun 4, 2024
1 parent 2fcdd4c commit 5b959c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/osdp_sys/cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ int pyosdp_cp_event_cb(void *data, int address, struct osdp_event *event)
pyosdp_cp_t *self = data;
PyObject *arglist, *result, *event_dict;

if (!self->event_cb)
return 0;

if (pyosdp_make_dict_event(&event_dict, event))
return -1;

Expand Down

0 comments on commit 5b959c2

Please sign in to comment.