mgcp_parse_audio_port_pt(): fix buffer overflow

Change-Id: I18c78d15eb1593f404b4741248225b68878b463f
This commit is contained in:
Neels Hofmeyr 2023-10-25 21:53:47 +02:00 committed by laforge
parent 5e5c7bc176
commit 8b663e4d7c
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ static int mgcp_parse_audio_port_pt(struct mgcp_response *r, char *line)
pt_str = strtok(line, " ");
while (1) {
/* Do not allow excessive payload types */
if (count > ARRAY_SIZE(r->codecs))
if (count >= ARRAY_SIZE(r->codecs))
goto response_parse_failure_pt;
pt_str = strtok(NULL, " ");