neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34898?usp=email )
Change subject: mgcp_parse_audio_port_pt(): fix buffer overflow ......................................................................
mgcp_parse_audio_port_pt(): fix buffer overflow
Change-Id: I18c78d15eb1593f404b4741248225b68878b463f --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/98/34898/1
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 5df4560..95c7a4b 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -319,7 +319,7 @@ pt_str = strtok(line, " "); while (1) { /* Do not allow excessive payload types */ - if (count > ARRAY_SIZE(r->codecs)) + if (count >= ARRAY_SIZE(r->ptmap)) goto response_parse_failure_pt;
pt_str = strtok(NULL, " ");