From 0c2873e726a6398794f6955816d862e6b8c9e849 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Tue, 25 Feb 2020 17:51:09 +0000 Subject: [PATCH] [mod_amr] scan-build: Array access (from variable 'tocs') results in a null pointer dereference - switch_amr_unpack_oa() --- src/mod/codecs/mod_amr/mod_amr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod/codecs/mod_amr/mod_amr.c b/src/mod/codecs/mod_amr/mod_amr.c index b36b4c9aa3..67426b81c8 100644 --- a/src/mod/codecs/mod_amr/mod_amr.c +++ b/src/mod/codecs/mod_amr/mod_amr.c @@ -150,6 +150,9 @@ static switch_bool_t switch_amr_unpack_oa(unsigned char *buf, uint8_t *tmp, int int index; int framesz; + if (!buf) { + return SWITCH_FALSE; + } buf++; /* CMR skip */ tocs = buf; index = ((tocs[0]>>3) & 0xf);