neels has uploaded this change for review.

View Change

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, " ");

To view, visit change 34898. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I18c78d15eb1593f404b4741248225b68878b463f
Gerrit-Change-Number: 34898
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange