Skip to content

app: Add runtime safety checks for AT host#223

Merged
SeppoTakalo merged 1 commit into
nrfconnect:mainfrom
SeppoTakalo:pipe_null_checks
Mar 20, 2026
Merged

app: Add runtime safety checks for AT host#223
SeppoTakalo merged 1 commit into
nrfconnect:mainfrom
SeppoTakalo:pipe_null_checks

Conversation

@SeppoTakalo
Copy link
Copy Markdown
Contributor

Various functions like:

  • check_idle_timer()
  • in_at_mode_*()
  • is_idle_*()
  • is_open_*()

are designed to tolerate NULL for either context or pipe pointer. This is because sm_at_host_get_current(), sm_at_host_get_pipe() and sm_at_host_get_current_pipe() are designed to return NULL when there is no context or pipe to point to.

However, few of those mentioned were not properly handling the NULL, especially the internal check_idle_timer() caused NULL pointer dereference if context was destroyed just before URC message was send to that pipe.

Various functions like:
* check_idle_timer()
* in_at_mode_*()
* is_idle_*()
* is_open_*()

are designed to tolerate NULL for either context or pipe
pointer. This is because sm_at_host_get_current(),
sm_at_host_get_pipe() and sm_at_host_get_current_pipe()
are designed to return NULL when there is no context or pipe
to point to.

However, few of those mentioned were not properly handling the NULL,
especially the internal check_idle_timer() caused NULL pointer
dereference if context was destroyed just before URC message was
send to that pipe.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
@SeppoTakalo SeppoTakalo merged commit c30f99e into nrfconnect:main Mar 20, 2026
3 checks passed
@SeppoTakalo SeppoTakalo deleted the pipe_null_checks branch March 20, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants