Merge pull request #416 from dragos-oancea/mod_amr-nullptr-deref

[mod_amr] scan-build: Array access (from variable 'tocs') results in a null pointer dereference - switch_amr_unpack_oa()
This commit is contained in:
Andrey Volk 2020-02-26 23:27:25 +04:00 committed by GitHub
commit 395afbefaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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);