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/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgHello Harald Welte, Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/3498
to look at the new patch set (#7).
libmsc: make pitfall in gsm0408_dispatch() more obvious
The function gsm0408_dispatch() accepts a message buffer pointer
and accesses the l3h pointer. Even in a properly allocated
message buffer, this may lead into a segfault if the user forgets
to set the l3h pointer. This commit adds assertions to popup a
more expressive error message.
Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
---
M src/libmsc/gsm_04_08.c
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3498/7
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 21bc2b8..90a0431 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -3216,13 +3216,17 @@
/* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- struct gsm48_hdr *gh = msgb_l3(msg);
- uint8_t pdisc = gsm48_hdr_pdisc(gh);
+ struct gsm48_hdr *gh;
+ uint8_t pdisc;
int rc = 0;
+ OSMO_ASSERT(msg->l3h)
OSMO_ASSERT(conn);
OSMO_ASSERT(msg);
+ gh = msgb_l3(msg);
+ pdisc = gsm48_hdr_pdisc(gh);
+
LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n",
gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)),
pdisc, gsm48_hdr_msg_type(gh));
--
To view, visit https://gerrit.osmocom.org/3498
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
Gerrit-PatchSet: 7
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>