Skip to content

Commit

Permalink
applications: serial_lte_modem: check for uninitialized send callback
Browse files Browse the repository at this point in the history
Calling slm_at_send_indicate() before the AT backend is initialized
will dereference a NULL pointer, which may happen as several modules
can dispatch custom notifications at any point.

Signed-off-by: Kacper Radoszewski <[email protected]>
  • Loading branch information
kacperradoszewski committed May 30, 2024
1 parent 0e99b70 commit 2233244
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions applications/serial_lte_modem/src/slm_at_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ static int slm_at_send_indicate(const uint8_t *data, size_t len,
if (k_is_in_isr()) {
LOG_ERR("FIXME: Attempt to send AT response (of size %u) in ISR.", len);
return -EINTR;
} else if (at_backend.send == NULL) {
LOG_ERR("Attempt to send via an uninitialized AT backend");
return -EFAULT;
}

if (indicate) {
Expand Down

0 comments on commit 2233244

Please sign in to comment.