[MERGED] openbsc[master]: mgcp_protocol: Ensure we don't call strtok_r with NULL data

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Dec 9 15:35:32 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: mgcp_protocol: Ensure we don't call strtok_r with NULL data
......................................................................


mgcp_protocol: Ensure we don't call strtok_r with NULL data

Change-Id: I1dce4df6a49fe95db592b0598194e3a8b8b1b994
Fixes: Coverity CID 135181
---
M openbsc/src/libmgcp/mgcp_protocol.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 2e728cb..18398fc 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -447,6 +447,7 @@
 	int i = 0;
 	char *elem, *save = NULL;
 
+	OSMO_ASSERT(data);
 	pdata->trans = "000000";
 
 	for (elem = strtok_r(data, " ", &save); elem;

-- 
To view, visit https://gerrit.osmocom.org/1324
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1dce4df6a49fe95db592b0598194e3a8b8b1b994
Gerrit-PatchSet: 5
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list