aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-03-02 13:28:52 +0100
committerMax <msuraev@sysmocom.de>2017-03-02 13:28:52 +0100
commit0436e42472a48a91cc6f743b3bca3f09a2ffd490 (patch)
treeee561008faf592d5945b04a271b3cc75a7ccee49 /openbsc
parentd3270a9c053c33b7d460bf3f84f7975c06cace52 (diff)
Fix potential segfault in sgsn_libgtp.c
* print pdp->address instead of mm->imsi if mm is NULL * print mm->imsi in debug log (move it below NULL check) Change-Id: I4fbf5a54019a46612fbc528d61120182738f9205
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index dde1e5e30..c26abc992 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -641,8 +641,6 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
struct msgb *msg;
uint8_t *ud;
- DEBUGP(DGPRS, "GTP DATA IND from GGSN, length=%u\n", len);
-
pdp = lib->priv;
if (!pdp) {
LOGP(DGPRS, LOGL_NOTICE,
@@ -652,10 +650,14 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
mm = pdp->mm;
if (!mm) {
LOGP(DGPRS, LOGL_ERROR,
- "PDP context (imsi=%s) without MM context!\n", mm->imsi);
+ "PDP context (address=%u) without MM context!\n",
+ pdp->address);
return -EIO;
}
+ DEBUGP(DGPRS, "GTP DATA IND from GGSN for %s, length=%u\n", mm->imsi,
+ len);
+
if (mm->ran_type == MM_CTX_T_UTRAN_Iu) {
#ifdef BUILD_IU
/* Ignore the packet for now and page the UE to get the RAB