[PATCH] osmo-ggsn[master]: gtp: Explicit OSMO_ASSERT to ensure pdp variable is set

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
Sun Nov 5 18:34:44 UTC 2017


Review at  https://gerrit.osmocom.org/4691

gtp: Explicit OSMO_ASSERT to ensure pdp variable is set

Change-Id: I09e37e25fd118ac0a54ab788304d3f5083463050
Fixes: Coverity CID#174335
---
M gtp/gtp.c
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/91/4691/1

diff --git a/gtp/gtp.c b/gtp/gtp.c
index c798192..b36e0c6 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -2635,6 +2635,12 @@
 	GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
 		    "Received Error Indication\n");
 
+	/* This is obvious from above code, given the semantics of the
+	 * functions above, but Coverity doesn't figure this out, so
+	 * let's make it clear. It's good style anyway in case above
+	 * code should ever change. */
+	OSMO_ASSERT(pdp);
+
 	if (gsn->cb_delete_context)
 		gsn->cb_delete_context(pdp);
 	pdp_freepdp(pdp);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09e37e25fd118ac0a54ab788304d3f5083463050
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list