[PATCH] libosmo-sccp[master]: osmo_sccp_user_sap_down(): Avoid uninitialized pointer deref

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
Thu Apr 27 09:50:08 UTC 2017


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

osmo_sccp_user_sap_down(): Avoid uninitialized pointer deref

When receiving an unknown primitive, we end up de-referencing an
unassigned/uninitialized pointer for 'conn'.  Let's properly catch that
case and print an error message.

Change-Id: Id1f5f293ea9bce8601d45164be670a7062d91802
Fixes: coverity CID#166947
---
M src/sccp_scoc.c
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/2430/1

diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index 6d9916b..3a52ca6 100644
--- a/src/sccp_scoc.c
+++ b/src/sccp_scoc.c
@@ -1628,6 +1628,11 @@
 			goto out;
 		}
 		break;
+	default:
+		LOGP(DLSCCP, LOGL_ERROR, "Received unknown primitive %s\n",
+			osmo_scu_prim_name(&prim->oph));
+		rc = -1;
+		goto out;
 	}
 
 	/* Map from primitive to event */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1f5f293ea9bce8601d45164be670a7062d91802
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list