Change in osmo-mgw[master]: mgcp_protocol: increase buffer space for codec name in LCO
dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/11466 ) Change subject: mgcp_protocol: increase buffer space for codec name in LCO .. mgcp_protocol: increase buffer space for codec name in LCO The function that parses the LCO uses an internal buffer to store the codec name that has been issued via LCO. This buffer is only 9 byte long, this means an 8 character string can be stored. If a codec name exceeds this limit it gets chopped. For example "GSM-HR-08" becomes "GSM-HR-0", which may mess up the codec negotiation. - Increase the buffer from 9 to 17 byte. Change-Id: I17ce7acde1f23ab1394227d74214fe2a55cd2264 Related: OS#3673 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 90c282c..3313164 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -579,7 +579,7 @@ const char *options) { char *p_opt, *a_opt; - char codec[9]; + char codec[17]; if (!options) return 0; @@ -605,7 +605,7 @@ * (e.g. a:PCMU;G726-32) But this implementation only supports a single * codec only. */ a_opt = strstr(lco->string, "a:"); - if (a_opt && sscanf(a_opt, "a:%8[^,]", codec) == 1) { + if (a_opt && sscanf(a_opt, "a:%16[^,]", codec) == 1) { talloc_free(lco->codec); lco->codec = talloc_strdup(ctx, codec); } -- To view, visit https://gerrit.osmocom.org/11466 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I17ce7acde1f23ab1394227d74214fe2a55cd2264 Gerrit-Change-Number: 11466 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter
Change in osmo-mgw[master]: mgcp_protocol: increase buffer space for codec name in LCO
Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/11466 ) Change subject: mgcp_protocol: increase buffer space for codec name in LCO .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/11466 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I17ce7acde1f23ab1394227d74214fe2a55cd2264 Gerrit-Change-Number: 11466 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 30 Oct 2018 12:47:42 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-mgw[master]: mgcp_protocol: increase buffer space for codec name in LCO
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/11466 Change subject: mgcp_protocol: increase buffer space for codec name in LCO .. mgcp_protocol: increase buffer space for codec name in LCO The function that parses the LCO uses an internal buffer to store the codec name that has been issued via LCO. This buffer is only 9 byte long, this means an 8 character string can be stored. If a codec name exceeds this limit it gets chopped. For example "GSM-HR-08" becomes "GSM-HR-0", which may mess up the codec negotiation. - Increase the buffer from 9 to 17 byte. Change-Id: I17ce7acde1f23ab1394227d74214fe2a55cd2264 Related: OS#3673 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/66/11466/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index e17bdae..860692f 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -518,7 +518,7 @@ const char *options) { char *p_opt, *a_opt; - char codec[9]; + char codec[17]; if (!options) return 0; @@ -544,7 +544,7 @@ * (e.g. a:PCMU;G726-32) But this implementation only supports a single * codec only. */ a_opt = strstr(lco->string, "a:"); - if (a_opt && sscanf(a_opt, "a:%8[^,]", codec) == 1) { + if (a_opt && sscanf(a_opt, "a:%16[^,]", codec) == 1) { talloc_free(lco->codec); lco->codec = talloc_strdup(ctx, codec); } -- To view, visit https://gerrit.osmocom.org/11466 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I17ce7acde1f23ab1394227d74214fe2a55cd2264 Gerrit-Change-Number: 11466 Gerrit-PatchSet: 1 Gerrit-Owner: dexter