From d1f751eb8ec04cfe75ff22988c742af64be45282 Mon Sep 17 00:00:00 2001
From: Dragos Oancea <dragos@signalwire.com>
Date: Wed, 12 Feb 2020 22:20:28 +0000
Subject: [PATCH] [spandsp] scan-build: Dereference of null pointer -
 at_put_response()

---
 libs/spandsp/src/at_interpreter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libs/spandsp/src/at_interpreter.c b/libs/spandsp/src/at_interpreter.c
index 50f1df11d5..8b95c48fa2 100644
--- a/libs/spandsp/src/at_interpreter.c
+++ b/libs/spandsp/src/at_interpreter.c
@@ -217,6 +217,8 @@ SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode)
 SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t)
 {
     uint8_t buf[3];
+   
+    if (!s) return; 
 
     buf[0] = s->p.s_regs[3];
     buf[1] = s->p.s_regs[4];