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.orgHarald Welte has submitted this change and it was merged.
Change subject: mgcp: do not fail silently on snprintf()
......................................................................
mgcp: do not fail silently on snprintf()
The snprintf() that is used to compose the fsm name on an assignment
request may cause a silent failure. The buffer is large enough to
take the string under all circumstances. If snprintf() fails, this
would mean we have some other serious problem.
use OSMO_ASSERT in case the snprintf() fails, so the failure
gets noticed.
Change-Id: I3c36df8cfd0880c524244048a993cd136be41f56
---
M src/osmo-bsc/osmo_bsc_mgcp.c
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c
index be6c7de..81a4093 100644
--- a/src/osmo-bsc/osmo_bsc_mgcp.c
+++ b/src/osmo-bsc/osmo_bsc_mgcp.c
@@ -1015,8 +1015,7 @@
OSMO_ASSERT(mgcp);
OSMO_ASSERT(conn);
- if(snprintf(name, sizeof(name), "MGW_%i", conn->conn_id) >= sizeof(name))
- return NULL;
+ OSMO_ASSERT(snprintf(name, sizeof(name), "MGW_%i", conn->conn_id) < sizeof(name));
/* Register the fsm description (if not already done) */
if (fsm_registered == false) {
--
To view, visit https://gerrit.osmocom.org/5073
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3c36df8cfd0880c524244048a993cd136be41f56
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder