This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_dfu.c tries to call event handler even if it is NULL

Hi Nordic, 

this isn't a request for help, just to let you know that there is a small bug in ble_dfu.c in SDK14.0.

When calling ble_dfu_buttonless_init, the init struct includes an event handler. At no point is it checked to see if evt_handler is NULL. The event handler is called in other places in the file, causing the program to crash if evt_handler is NULL. I think that either

  • the init function should return an error when initialising, if evt_handler is NULL or,
  • ble_dfu.c should not call evt_handler if it is NULL

regards,

goldwake

Related