Change in ...osmo-mgw[master]: mgcp_codec_add: fix audio_name size check

neels gerrit-no-reply at lists.osmocom.org
Thu Aug 29 03:56:22 UTC 2019


neels has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15301 )

Change subject: mgcp_codec_add: fix audio_name size check
......................................................................

mgcp_codec_add: fix audio_name size check

Needs to account for terminating '\0'.

Change-Id: I27896beef6ffcc1cb6207daaba6c8b2b03eb513d
---
M src/libosmo-mgcp/mgcp_codec.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 704b7e6..9e55ab0 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -179,7 +179,7 @@
 	/* Now we extract the codec subtype name, rate and channels. The latter
 	 * two are optional. If they are not present we use the safe defaults
 	 * above. */
-	if (strlen(audio_name) > sizeof(audio_codec)) {
+	if (strlen(audio_name) >= sizeof(audio_codec)) {
 		LOGP(DLMGCP, LOGL_ERROR, "Audio codec too long: %s\n", osmo_quote_str(audio_name, -1));
 		goto error;
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15301
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I27896beef6ffcc1cb6207daaba6c8b2b03eb513d
Gerrit-Change-Number: 15301
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190829/a7484383/attachment.html>


More information about the gerrit-log mailing list